mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Fix storing empty-trash task
It was wrongly stored using RPeriodicTask directly, but the higher level `UserTask` must be used instead, because this ensures a correctly scoped periodic task using the `updateOneTask` method. Since this is a system task, it can be given a fixed ID which makes it now safe even if stored using RPeriodicTask directly. The bug resulted in multiple empty-trash tasks to be inserted (on each restart). Refs: #347
This commit is contained in:
@ -0,0 +1,3 @@
|
||||
-- note this is only for users of nightly releases
|
||||
DELETE FROM "periodic_task"
|
||||
WHERE "task" = 'empty-trash';
|
@ -0,0 +1,3 @@
|
||||
-- note this is only for users of nightly releases
|
||||
DELETE FROM `periodic_task`
|
||||
WHERE `task` = 'empty-trash';
|
@ -0,0 +1,3 @@
|
||||
-- note this is only for users of nightly releases
|
||||
DELETE FROM "periodic_task"
|
||||
WHERE "task" = 'empty-trash';
|
@ -81,7 +81,8 @@ trait UserTaskStore[F[_]] {
|
||||
*
|
||||
* Unlike `updateTask`, this ensures that there is at most one task of some name in the
|
||||
* db. Multiple same tasks (task with same name) may not be allowed to run, depending
|
||||
* on what they do. This is not ensured by the database, though.
|
||||
* on what they do. This is not ensured by the database, though. The task is identified
|
||||
* by task name, submitter and group.
|
||||
*
|
||||
* If there are currently multiple tasks with same name as `ut` for the user `account`,
|
||||
* they will all be removed and the given task inserted!
|
||||
|
Reference in New Issue
Block a user