Use a minimum age of items to remove

In order to keep deleted items for a while, the periodic task can now
use a duration to only remove items with a certain age. This can be
used to ensure that a deleted item stays at least X days before it
will be removed from the database.

Refs: #347
This commit is contained in:
eikek
2021-08-15 12:28:42 +02:00
parent d136bb8166
commit f4a2b86ea8
27 changed files with 303 additions and 124 deletions

View File

@ -158,6 +158,7 @@ import Api.Model.CustomFieldValue exposing (CustomFieldValue)
import Api.Model.DirectionValue exposing (DirectionValue)
import Api.Model.EmailSettings exposing (EmailSettings)
import Api.Model.EmailSettingsList exposing (EmailSettingsList)
import Api.Model.EmptyTrashSetting exposing (EmptyTrashSetting)
import Api.Model.Equipment exposing (Equipment)
import Api.Model.EquipmentList exposing (EquipmentList)
import Api.Model.FolderDetail exposing (FolderDetail)
@ -999,13 +1000,14 @@ startClassifier flags receive =
startEmptyTrash :
Flags
-> EmptyTrashSetting
-> (Result Http.Error BasicResult -> msg)
-> Cmd msg
startEmptyTrash flags receive =
startEmptyTrash flags setting receive =
Http2.authPost
{ url = flags.config.baseUrl ++ "/api/v1/sec/collective/emptytrash/startonce"
, account = getAccount flags
, body = Http.emptyBody
, body = Http.jsonBody (Api.Model.EmptyTrashSetting.encode setting)
, expect = Http.expectJson receive Api.Model.BasicResult.decoder
}