Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Start cronjobs after the database has been migrated #34215

Merged
merged 3 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lucky-wolves-turn.md
Original file line number Diff line number Diff line change
@@ -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.
8 changes: 3 additions & 5 deletions apps/meteor/server/startup/cron.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -12,14 +11,13 @@ import { videoConferencesCron } from '../cron/videoConferences';

const logger = new Logger('SyncedCron');

Meteor.defer(async () => {
export const startCronJobs = async (): Promise<void> => {
await startCron();
lucas-a-pelegrino marked this conversation as resolved.
Show resolved Hide resolved

await oembedCron();
await usageReportCron(logger);
await npsCron();
await temporaryUploadCleanupCron();
await federationCron();
await videoConferencesCron();
await userDataDownloadsCron();
});
userDataDownloadsCron();
};
4 changes: 3 additions & 1 deletion apps/meteor/server/startup/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import './appcache';
import './callbacks';
import './cron';
import { startCronJobs } from './cron';
import './initialData';
import './serverRunning';
import './coreApps';
Expand All @@ -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');
Expand Down
Loading