Skip to content

Reduce concurrency in dartdoc job execution #1391

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/bin/service/dartdoc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void _workerMain(WorkerEntryMessage message) {
message.statsSendPort.send(await jobBackend.stats(JobService.dartdoc));
});

await jobMaintenance.run(taskReceivePort, concurrency: 2);
await jobMaintenance.run(taskReceivePort);
});
}

Expand Down
6 changes: 2 additions & 4 deletions app/lib/job/job.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,14 @@ class JobMaintenance {
final JobProcessor _processor;
JobMaintenance(this._db, this._processor);

Future run(Stream taskStream, {int concurrency: 1}) {
Future run(Stream taskStream) {
final futures = <Future>[
syncNotifications(taskStream),
syncDatastoreHead(),
syncDatastoreHistory(),
updateStates(),
_processor.run(),
];
for (int i = 0; i < concurrency; i++) {
futures.add(_processor.run());
}
return Future.wait(futures);
}

Expand Down