From d5dfecc19f936eba6a73448b54e57c09e8e6e7fb Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Thu, 24 Mar 2022 16:32:31 +0000 Subject: [PATCH] Server: Automatically delete expired sessions --- packages/server/src/utils/setupTaskService.ts | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/packages/server/src/utils/setupTaskService.ts b/packages/server/src/utils/setupTaskService.ts index f6de725e7..908283870 100644 --- a/packages/server/src/utils/setupTaskService.ts +++ b/packages/server/src/utils/setupTaskService.ts @@ -46,17 +46,12 @@ export default function(env: Env, models: Models, config: Config, services: Serv run: (models: Models) => models.user().handleOversizedAccounts(), }, - // This should be enabled eventually. As of version 2.5 - // (2021-11-08T11:07:11Z) all Joplin clients support handling of expired - // sessions, however we don't know how many people have Joplin 2.5+ so - // be safe we don't enable it just yet. - - // { - // id: TaskId.DeleteExpiredSessions, - // description: taskIdToLabel(TaskId.DeleteExpiredSessions), - // schedule: '0 */6 * * *', - // run: (models: Models) => models.session().deleteExpiredSessions(), - // }, + { + id: TaskId.DeleteExpiredSessions, + description: taskIdToLabel(TaskId.DeleteExpiredSessions), + schedule: '0 */6 * * *', + run: (models: Models) => models.session().deleteExpiredSessions(), + }, ]; if (config.USER_DATA_AUTO_DELETE_ENABLED) {