mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 03:44:29 +03:00
Moved members migrations to one off job
refs https://github.com/TryGhost/Toolbox/issues/358 - The execution of members migration only ever has to be done once in the lifetime of the Ghost instance. It is slightly slow and blocking process, which slows down instance boot time considerably. Putting the execution into one off job allows to execute migrations only once and save boot time on each consequent instance restart - less resource usage, save the planet!
This commit is contained in:
parent
6d5a5e90b1
commit
1606a10ff8
@ -148,7 +148,16 @@ module.exports = {
|
||||
}
|
||||
})();
|
||||
|
||||
await stripeService.migrations.execute();
|
||||
const membersMigrationJobName = 'members-migrations';
|
||||
if (!(await jobsService.hasExecuted(membersMigrationJobName))) {
|
||||
jobsService.addOneOffJob({
|
||||
name: membersMigrationJobName,
|
||||
offloaded: false,
|
||||
job: stripeService.migrations.execute.bind(stripeService.migrations)
|
||||
});
|
||||
|
||||
await jobsService.awaitCompletion(membersMigrationJobName);
|
||||
}
|
||||
},
|
||||
contentGating: require('./content-gating'),
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user