A scheduler is only started for a library stored inside a Git repository. The "Regularly pull remote changes" setting is read on every run, so switching it takes effect without reopening the library, the interval is read once, when the scheduler starts.
| Modifier and Type | Field and Description |
|---|---|
| private final BibDatabaseContext | |
| private final ScheduledThreadPoolExecutor | |
| private final BooleanSupplier | |
| private static final Logger | |
| private static final Set |
| Access | Constructor and Description |
|---|---|
| private | GitPullScheduler(BibDatabaseContext bibDatabaseContext, GitAutoSync gitAutoSync, BooleanSupplier hasUnsavedChanges, int intervalInMinutes)
|
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static boolean | |
| private void | |
| public static void | shutdown(BibDatabaseContext
Associated bibDatabaseContext)BibDatabaseContextShuts down the scheduler which is associated with the given |
| public static void | start(BibDatabaseContext
Associated bibDatabaseContext, DialogService dialogService, GuiPreferences preferences, StateManager stateManager, TaskExecutor taskExecutor, GitHandlerRegistry gitHandlerRegistry, BooleanSupplier hasUnsavedChanges)BibDatabaseContextStarts the scheduler for the given library, if it is stored inside a Git repository and has no scheduler yet. |
| bibDatabaseContext | back to summary |
|---|---|
| private final BibDatabaseContext bibDatabaseContext | |
| executor | back to summary |
|---|---|
| private final ScheduledThreadPoolExecutor executor | |
| hasUnsavedChanges | back to summary |
|---|---|
| private final BooleanSupplier hasUnsavedChanges | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| RUNNING_INSTANCES | back to summary |
|---|---|
| private static final Set<GitPullScheduler> RUNNING_INSTANCES | |
| GitPullScheduler | back to summary |
|---|---|
| private GitPullScheduler(BibDatabaseContext bibDatabaseContext, GitAutoSync gitAutoSync, BooleanSupplier hasUnsavedChanges, int intervalInMinutes) | |
| isRunning | back to summary |
|---|---|
| pack-priv static boolean isRunning(BibDatabaseContext bibDatabaseContext) | |
| pull | back to summary |
|---|---|
| private void pull(GitAutoSync gitAutoSync) Runs one scheduled pull. Skips while the library has unsaved changes, because a merge would be applied underneath the user's edits. Exceptions are caught, because scheduleAtFixedRate silently cancels the schedule for the rest of the session if the task throws. | |
| shutdown | back to summary |
|---|---|
| public static void shutdown(BibDatabaseContext bibDatabaseContext) Shuts down the scheduler which is associated with the given
| |
| start | back to summary |
|---|---|
| public static void start(BibDatabaseContext bibDatabaseContext, DialogService dialogService, GuiPreferences preferences, StateManager stateManager, TaskExecutor taskExecutor, GitHandlerRegistry gitHandlerRegistry, BooleanSupplier hasUnsavedChanges) Starts the scheduler for the given library, if it is stored inside a Git repository and has no scheduler yet. This method is not thread-safe. The caller has to ensure that this method is not called in parallel.
| |