Backup and reset MWL on a schedule - #76
Conversation
The worklist is inherently ephemeral. Stale worklist items from a previous day are not meaningful to the modality and could cause confusion if they appeared in a C-FIND response. Therefore we backup and reset the MWL database on a configurable schedule (default: daily at 02:00 UTC). + The schedule is configured via a cron expression stored in an env var (`MWL_RESET_SCHEDULE`).
steventux
left a comment
There was a problem hiding this comment.
I think if we are taking this app level approach to scheduling we need to remove the batch scripts which set up the window scheduler tasks scheduling the original database backups.
21a5a69 to
febe6c7
Compare
There was a problem hiding this comment.
I'm not convinced that bringing backup/clear db functionality into the service layer is particularly clean.
Perhaps it's a remnant of the application-level scheduling introduced in this PR initially but it feels like an interface for something that happens outside the running of any application logic.
This feature is somewhat equivalent to a django admin task or a make task which don't typically live deep in application code, I think we can still test a script form of database backup.
Thanks Steve. That's reasonable. Have pushed an update with logic shifted away from the application layer. |
The worklist is inherently ephemeral. Stale worklist items from a previous day are not meaningful to the modality and could cause confusion if they appeared in a C-FIND response.
Therefore we backup and reset the MWL database on a configurable schedule (default: daily at 02:00 UTC).
The schedule is configured via a cron expression stored in an env var (
MWL_RESET_SCHEDULE).Jira link
https://nhsd-jira.digital.nhs.uk/browse/DTOSS-12566