diff --git a/src/main/java/io/supertokens/Main.java b/src/main/java/io/supertokens/Main.java index 8df83bd5d..3620b2bf8 100644 --- a/src/main/java/io/supertokens/Main.java +++ b/src/main/java/io/supertokens/Main.java @@ -254,6 +254,9 @@ private void init() throws IOException, StorageQueryException { // starts DeleteExpiredAccessTokenSigningKeys cronjob if the access token signing keys can change Cronjobs.addCronjob(this, DeleteExpiredAccessTokenSigningKeys.init(this, uniqueUserPoolIdsTenants)); + // this is to ensure tenantInfos are in sync for the new cron job as well + MultitenancyHelper.getInstance(this).refreshCronjobs(); + // creates password hashing pool PasswordHashing.init(this); diff --git a/src/main/java/io/supertokens/cronjobs/Cronjobs.java b/src/main/java/io/supertokens/cronjobs/Cronjobs.java index 96fddf564..0be582b31 100644 --- a/src/main/java/io/supertokens/cronjobs/Cronjobs.java +++ b/src/main/java/io/supertokens/cronjobs/Cronjobs.java @@ -96,9 +96,6 @@ public static void addCronjob(Main main, CronTask task) { instance.executor.scheduleWithFixedDelay(task, task.getInitialWaitTimeSeconds(), task.getIntervalTimeSeconds(), TimeUnit.SECONDS); instance.tasks.add(task); - - // this is to ensure tenantInfos are in sync for the new cron job as well - MultitenancyHelper.getInstance(main).refreshCronjobs(); } } }