Skip to content

Commit 4db839e

Browse files
authored
Revert "ZMS-274 Implement MongoDb Migrations in Wildduck (#877)" (#878)
This reverts commit 4866524.
1 parent fb01977 commit 4db839e

File tree

6 files changed

+5
-304
lines changed

6 files changed

+5
-304
lines changed

lib/task-handler.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class TaskHandler {
3838
throw new Error('Failed to create task');
3939
}
4040

41-
log.verbose('Tasks', 'Created task id=%s type=%s', insRes.insertedId, type);
41+
log.verbose('Tasks', 'Created task id=%s', insRes.insertedId);
4242

4343
return insRes.insertedId;
4444
}
@@ -88,10 +88,10 @@ class TaskHandler {
8888

8989
let existing = false;
9090
if (r && r.lastErrorObject && r.lastErrorObject.upserted) {
91-
log.verbose('Tasks', 'Created task id=%s type=%s', r.value._id, type);
91+
log.verbose('Tasks', 'Created task id=%s', r.value._id);
9292
} else {
9393
existing = true;
94-
log.verbose('Tasks', 'Updated task id=%s type=%s', r.value._id, type);
94+
log.verbose('Tasks', 'Updated task id=%s', r.value._id);
9595
}
9696

9797
return { existing, task: r.value._id };

lib/tasks/run-migrations.js

Lines changed: 0 additions & 108 deletions
This file was deleted.

migrations/database/addressregister_add_disabled.js

Lines changed: 0 additions & 62 deletions
This file was deleted.

migrations/users/addresses_to_domaincache.js

Lines changed: 0 additions & 62 deletions
This file was deleted.

migrations/users/domainaliases_to_domaincache.js

Lines changed: 0 additions & 57 deletions
This file was deleted.

tasks.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ const taskAcmeUpdate = require('./lib/tasks/acme-update');
2929
const taskClearFolder = require('./lib/tasks/clear-folder');
3030
const taskSearchApply = require('./lib/tasks/search-apply');
3131
const taskUserIndexing = require('./lib/tasks/user-indexing');
32-
const taskRunMigrations = require('./lib/tasks/run-migrations');
3332

3433
let messageHandler;
3534
let mailboxHandler;
@@ -139,13 +138,11 @@ module.exports.start = callback => {
139138
gcTimeout = setTimeout(clearExpiredMessages, consts.GC_INTERVAL);
140139
gcTimeout.unref();
141140

142-
// start processing pending tasks in 5 minutes after start
141+
// start processing pending tasks in 5 minuytes after start
143142
taskTimeout = setTimeout(runTasks, consts.TASK_STARTUP_INTERVAL);
144143
taskTimeout.unref();
145144
});
146145

147-
taskHandler.add('run-migrations', {});
148-
149146
return callback();
150147
};
151148

@@ -707,14 +704,7 @@ function processTask(task, data, callback) {
707704
callback(null, true);
708705
}
709706
);
710-
case 'run-migrations':
711-
return taskRunMigrations(task, data, { db }, err => {
712-
if (err) {
713-
return callback(err);
714-
}
715-
// release
716-
callback(null, true);
717-
});
707+
718708
default:
719709
// release task by returning true
720710
return callback(null, true);

0 commit comments

Comments
 (0)