X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44..53593baa211863fbf66540cf1bcc36c8fb37257f:/sql/Pg-upgrade2/background_jobs_clean_auth_sessions.sql

diff --git a/sql/Pg-upgrade2/background_jobs_clean_auth_sessions.sql b/sql/Pg-upgrade2/background_jobs_clean_auth_sessions.sql
new file mode 100644
index 000000000..35430a3ef
--- /dev/null
+++ b/sql/Pg-upgrade2/background_jobs_clean_auth_sessions.sql
@@ -0,0 +1,12 @@
+-- @tag: background_jobs_clean_auth_sessions
+-- @description: Hintergrundjob zum LÃ¶schen abgelaufener Sessions
+-- @depends: release_3_1_0
+INSERT INTO background_jobs (type, package_name, active, cron_spec, next_run_at)
+VALUES ('interval', 'CleanAuthSessions', true, '30 6 * * *',
+  CAST(current_date AS timestamp) + CAST(
+    (CASE
+     WHEN extract('hour' FROM current_timestamp) < 6 THEN '6 hours 30 minutes'
+     ELSE                                                 '1 day 6 hours 30 minutes'
+     END) AS interval
+  )
+);
