Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Feature: Move schedule monitoring to its own thread #4

Draft
wants to merge 1 commit into
base: paperless-main
Choose a base branch
from

Conversation

stumpylog
Copy link
Member

Previous Architecture

Previous, every 30 cycles through the sentinel guard loop, the database was queried for schedules which need to be run. This assumed the guard loop was executed at once per second and also adds additional unnecessary work roughly every 30 seconds.

New Architecture

With this change, the scheduler check is preformed in a dedicated thread, which blocks for 60s, then queries the database. As the highest resolution of schedules is one minute, this means the check is done as infrequently as possible.

Considerations

There will be some slight time drift, as the call to scheduler is not a zero-time call, but the drift should be in the order of milliseconds and we're not a hard real time scheduling system here.

@stumpylog stumpylog force-pushed the feature-scheduler-thread branch from 422dbb8 to 449c2a6 Compare September 3, 2022 14:36
@stumpylog stumpylog force-pushed the feature-scheduler-thread branch 2 times, most recently from 7d28de7 to d00cfa5 Compare September 12, 2022 20:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant