mirror of
https://github.com/wekan/wekan.git
synced 2026-01-23 17:56:09 +01:00
Fix DB migration from 8.19 to 8.20 is in a loop.
Thanks to MaccabeeY and xet7 ! Fixes #6072
This commit is contained in:
parent
a787bcddf3
commit
2fa490d83d
1 changed files with 17 additions and 0 deletions
|
|
@ -645,6 +645,11 @@ class CronMigrationManager {
|
|||
*/
|
||||
async runMigrationStep(step) {
|
||||
try {
|
||||
// Check if already completed
|
||||
if (step.completed) {
|
||||
return; // Skip if already completed
|
||||
}
|
||||
|
||||
// Starting migration step
|
||||
|
||||
cronMigrationCurrentStep.set(step.name);
|
||||
|
|
@ -666,6 +671,9 @@ class CronMigrationManager {
|
|||
step.progress = 100;
|
||||
step.status = 'completed';
|
||||
|
||||
// Remove the cron job to prevent re-running every minute
|
||||
SyncedCron.remove(step.cronName);
|
||||
|
||||
// Completed migration step
|
||||
|
||||
// Update progress
|
||||
|
|
@ -692,6 +700,15 @@ class CronMigrationManager {
|
|||
this.startTime = Date.now();
|
||||
|
||||
try {
|
||||
// Remove cron jobs to prevent conflicts with job queue
|
||||
this.migrationSteps.forEach(step => {
|
||||
try {
|
||||
SyncedCron.remove(step.cronName);
|
||||
} catch (error) {
|
||||
// Ignore errors if cron job doesn't exist
|
||||
}
|
||||
});
|
||||
|
||||
// Add all migration steps to the job queue
|
||||
for (let i = 0; i < this.migrationSteps.length; i++) {
|
||||
const step = this.migrationSteps[i];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue