jobqueue: store an expiry date

This introduces an expiry date (default: 14 days from insert date) and
adjust the service-maintenance script to delete jobs that are older than
the expiration date.
This commit is contained in:
Simon de Vlieger 2022-07-08 16:55:27 +02:00 committed by Sanne Raymaekers
parent 37fc807bfa
commit 78ae275c61
4 changed files with 59 additions and 113 deletions

View file

@ -72,6 +72,7 @@ type job struct {
QueuedAt time.Time `json:"queued_at,omitempty"`
StartedAt time.Time `json:"started_at,omitempty"`
FinishedAt time.Time `json:"finished_at,omitempty"`
ExpiresAt time.Time `json:"expires_at,omitempty"`
Canceled bool `json:"canceled,omitempty"`
}