Skip to content

Commit 3b33a0e

Browse files
committed
Bump package:gcloud, make metadata updates non-critical
1 parent 62b9db2 commit 3b33a0e

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

app/lib/package/api_export/exported_api.dart

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,14 @@ final class ExportedBlob extends ExportedObject {
631631
// _retouchDeadline
632632
final retouchDeadline = clock.agoBy(_updateValidatedAfter);
633633
if (destinationInfo.metadata.validated.isBefore(retouchDeadline)) {
634-
await _owner._bucket.updateMetadata(dst, _metadata());
634+
try {
635+
await _owner._bucket.updateMetadata(dst, _metadata());
636+
} catch (e, st) {
637+
// This shouldn't happen, but if a metadata update does fail, it's
638+
// hardly the end of the world.
639+
// We might detect stray files later as a result of this.
640+
_log.warning('Failed to updateMetadata on "$dst" failed', e, st);
641+
}
635642
}
636643
return;
637644
}
@@ -659,7 +666,14 @@ extension on Bucket {
659666
if (info.isSameContent(bytes)) {
660667
if (info.metadata.validated
661668
.isBefore(clock.agoBy(_updateValidatedAfter))) {
662-
await updateMetadata(name, metadata);
669+
try {
670+
await updateMetadata(name, metadata);
671+
} catch (e, st) {
672+
// This shouldn't happen, but if a metadata update does fail, it's
673+
// hardly the end of the world.
674+
// We might detect stray files later as a result of this.
675+
_log.warning('Failed to updateMetadata on "$name" failed', e, st);
676+
}
663677
}
664678
return;
665679
}

app/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies:
1717
fake_async: ^1.2.0
1818
fake_gcloud:
1919
path: ../pkg/fake_gcloud
20-
gcloud: ^0.8.17
20+
gcloud: ^0.8.18
2121
googleapis: ^13.0.0
2222
googleapis_auth: ^1.1.0
2323
html: ^0.15.0

pkg/fake_gcloud/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ environment:
77
resolution: workspace
88

99
dependencies:
10-
gcloud: ^0.8.17
10+
gcloud: ^0.8.18
1111
logging: '>=0.11.3 <2.0.0'
1212
clock: ^1.1.0
1313

0 commit comments

Comments
 (0)