From f46b8712a176fd750df461d25902da4509336a45 Mon Sep 17 00:00:00 2001 From: Rolf Schmidt Date: Mon, 26 Apr 2021 13:23:00 +0100 Subject: [PATCH] Fixes #3526 - Default session timeout verification on backend only once a hour. --- db/migrate/20210426000000_scheduler_session_timeout.rb | 8 ++++++++ db/seeds/schedulers.rb | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20210426000000_scheduler_session_timeout.rb diff --git a/db/migrate/20210426000000_scheduler_session_timeout.rb b/db/migrate/20210426000000_scheduler_session_timeout.rb new file mode 100644 index 000000000..dfb4028f3 --- /dev/null +++ b/db/migrate/20210426000000_scheduler_session_timeout.rb @@ -0,0 +1,8 @@ +class SchedulerSessionTimeout < ActiveRecord::Migration[5.2] + def change + + return if !Setting.exists?(name: 'system_init_done') + + Scheduler.find_by(name: 'Cleanup dead sessions.').update(period: 1.hour) + end +end diff --git a/db/seeds/schedulers.rb b/db/seeds/schedulers.rb index bec27d043..a3f65c839 100644 --- a/db/seeds/schedulers.rb +++ b/db/seeds/schedulers.rb @@ -139,7 +139,7 @@ Scheduler.create_or_update( Scheduler.create_or_update( name: 'Cleanup dead sessions.', method: 'SessionTimeoutJob.perform_now', - period: 1.minute, + period: 1.hour, prio: 2, active: true, updated_by_id: 1,