From 80a5cb9b5238b5e538919361c295ef971b2618c5 Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Wed, 18 Dec 2024 10:37:22 -0600 Subject: [PATCH 1/2] Dont run crons before migrating the database --- apps/meteor/server/startup/cron.ts | 8 +++----- apps/meteor/server/startup/index.ts | 4 +++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/meteor/server/startup/cron.ts b/apps/meteor/server/startup/cron.ts index 308d1297a01a..8951038f80fe 100644 --- a/apps/meteor/server/startup/cron.ts +++ b/apps/meteor/server/startup/cron.ts @@ -1,5 +1,4 @@ import { Logger } from '@rocket.chat/logger'; -import { Meteor } from 'meteor/meteor'; import { federationCron } from '../cron/federation'; import { npsCron } from '../cron/nps'; @@ -12,14 +11,13 @@ import { videoConferencesCron } from '../cron/videoConferences'; const logger = new Logger('SyncedCron'); -Meteor.defer(async () => { +export const startCronJobs = async (): Promise => { await startCron(); - await oembedCron(); await usageReportCron(logger); await npsCron(); await temporaryUploadCleanupCron(); await federationCron(); await videoConferencesCron(); - await userDataDownloadsCron(); -}); + userDataDownloadsCron(); +}; diff --git a/apps/meteor/server/startup/index.ts b/apps/meteor/server/startup/index.ts index 001af2c12be5..048735bba752 100644 --- a/apps/meteor/server/startup/index.ts +++ b/apps/meteor/server/startup/index.ts @@ -1,6 +1,6 @@ import './appcache'; import './callbacks'; -import './cron'; +import { startCronJobs } from './cron'; import './initialData'; import './serverRunning'; import './coreApps'; @@ -13,6 +13,8 @@ import { isRunningMs } from '../lib/isRunningMs'; export const startup = async () => { await performMigrationProcedure(); + + setImmediate(() => startCronJobs()); // only starts network broker if running in micro services mode if (!isRunningMs()) { require('./localServices'); From 03c1460afd0b8b77cb9ae4387dda95a06bd6b9a9 Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Wed, 18 Dec 2024 10:44:44 -0600 Subject: [PATCH 2/2] Create lucky-wolves-turn.md --- .changeset/lucky-wolves-turn.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/lucky-wolves-turn.md diff --git a/.changeset/lucky-wolves-turn.md b/.changeset/lucky-wolves-turn.md new file mode 100644 index 000000000000..0dbb08af9e0f --- /dev/null +++ b/.changeset/lucky-wolves-turn.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fixes a UI issue that showed the incorrect migration number on the `Information` page. This was caused by a function calculating the stats before the server had migrated the database and updated the control.