Make FastJobStorage synchronous again.

This commit is contained in:
Greyson Parrelli
2020-12-03 09:58:08 -05:00
parent ebaa4cee65
commit 7868c3094b
6 changed files with 46 additions and 83 deletions

View File

@@ -77,11 +77,6 @@ class JobController {
notifyAll();
}
@WorkerThread
synchronized void flush() {
jobStorage.flush();
}
@WorkerThread
synchronized void submitNewJobChain(@NonNull List<List<Job>> chain) {
chain = Stream.of(chain).filterNot(List::isEmpty).toList();

View File

@@ -320,10 +320,7 @@ public class JobManager implements ConstraintObserver.Notifier {
public void flush() {
CountDownLatch latch = new CountDownLatch(1);
runOnExecutor(() -> {
jobController.flush();
latch.countDown();
});
runOnExecutor(latch::countDown);
try {
latch.await();

View File

@@ -11,9 +11,6 @@ public interface JobStorage {
@WorkerThread
void init();
@WorkerThread
void flush();
@WorkerThread
void insertJobs(@NonNull List<FullSpec> fullSpecs);