Periodically GC expired emails

This commit is contained in:
Saku Laesvuori 2023-09-28 14:48:37 +03:00
parent b5ef36a1bb
commit eeba024c1f
Signed by: slaesvuo
GPG Key ID: 257D284A2A1D3A32
1 changed files with 10 additions and 0 deletions

View File

@ -7,6 +7,7 @@
#:use-module (gnu services certbot)
#:use-module (gnu services configuration)
#:use-module (gnu services databases)
#:use-module (gnu services mcron)
#:use-module (gnu services shepherd)
#:use-module (gnu services web)
#:use-module (gnu system shadow)
@ -131,11 +132,20 @@
(datarekisteri-backend)
(list datarekisteri-backend)))
(define (backend-mcron-jobs config)
(match-record config <plain-datarekisteri-backend-configuration>
(datarekisteri-backend)
(list
#~(job '(next-minute '(0))
(string-append #$datarekisteri-backend "/bin/datarekisteri-cli gc-expired-emails")
#:user "datarekisteri-backend"))))
(define plain-datarekisteri-backend-service-type
(service-type
(name 'plain-datarekisteri-backend)
(extensions
(list (service-extension account-service-type backend-accounts)
(service-extension mcron-service-type backend-mcron-jobs)
(service-extension postgresql-role-service-type backend-postgresql-roles)
(service-extension profile-service-type backend-profile)
(service-extension shepherd-root-service-type backend-shepherd-service)))