Skip to content

Commit

Permalink
No need for "synchronized" at autosave, because there is a throttler (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor authored Aug 15, 2022
1 parent 50d94d8 commit 132921c
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,14 @@ private AutosaveManager(BibDatabaseContext bibDatabaseContext) {
}

@Subscribe
public synchronized void listen(@SuppressWarnings("unused") BibDatabaseContextChangedEvent event) {
public void listen(@SuppressWarnings("unused") BibDatabaseContextChangedEvent event) {
if (!event.isFilteredOut()) {
startAutosaveTask();
throttler.schedule(() -> {
eventBus.post(new AutosaveEvent());
});
}
}

private void startAutosaveTask() {
throttler.schedule(() -> {
eventBus.post(new AutosaveEvent());
});
}

private void shutdown() {
changeFilter.unregisterListener(this);
changeFilter.shutdown();
Expand Down

0 comments on commit 132921c

Please sign in to comment.