Skip to content

Commit

Permalink
Explicit injection of Storage into ApiExporter. (#8275)
Browse files Browse the repository at this point in the history
  • Loading branch information
isoos authored Nov 14, 2024
1 parent 8b9b9ec commit 32fc41d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/lib/package/api_export/api_exporter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ final class ApiExporter {

ApiExporter(
this._db, {
required Storage storageService,
required Bucket bucket,
}) : _api = ExportedApi(storageService, bucket);

Expand Down
1 change: 1 addition & 0 deletions app/lib/service/services.dart
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ Future<R> _withPubServices<R>(FutureOr<R> Function() fn) async {
if (activeConfiguration.exportedApiBucketName != null) {
registerApiExporter(ApiExporter(
dbService,
storageService: storageService,
bucket:
storageService.bucket(activeConfiguration.exportedApiBucketName!),
));
Expand Down
6 changes: 4 additions & 2 deletions app/test/package/api_export/api_exporter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ void main() {
(fakeTime) async {
await storageService.createBucket('bucket');
final bucket = storageService.bucket('bucket');
final apiExporter = ApiExporter(dbService, bucket: bucket);
final apiExporter =
ApiExporter(dbService, storageService: storageService, bucket: bucket);

await _testExportedApiSynchronization(
fakeTime,
Expand All @@ -62,7 +63,8 @@ void main() {
(fakeTime) async {
await storageService.createBucket('bucket');
final bucket = storageService.bucket('bucket');
final apiExporter = ApiExporter(dbService, bucket: bucket);
final apiExporter = ApiExporter(dbService,
storageService: storageService, bucket: bucket);

await apiExporter.synchronizeExportedApi();

Expand Down

0 comments on commit 32fc41d

Please sign in to comment.