mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Disabled members migrations in test environment
- it turns out we're running the members migration job in tests, and these run every time we boot Ghost. Given we wipe the DB each time, this forces the job to run, which is just burning valuable test time - the reason this block of code is slow is because it waits 500ms to see if the job has completed - we run this 55 times, as of writing, during the E2E tests, so that's over 27s of idle time - this commit gates running the migrations to outside of the test environment
This commit is contained in:
parent
d3a8b64f20
commit
bf63e250ad
1 changed files with 10 additions and 8 deletions
|
@ -148,15 +148,17 @@ module.exports = {
|
|||
}
|
||||
})();
|
||||
|
||||
const membersMigrationJobName = 'members-migrations';
|
||||
if (!(await jobsService.hasExecutedSuccessfully(membersMigrationJobName))) {
|
||||
jobsService.addOneOffJob({
|
||||
name: membersMigrationJobName,
|
||||
offloaded: false,
|
||||
job: stripeService.migrations.execute.bind(stripeService.migrations)
|
||||
});
|
||||
if (!env?.startsWith('testing')) {
|
||||
const membersMigrationJobName = 'members-migrations';
|
||||
if (!(await jobsService.hasExecutedSuccessfully(membersMigrationJobName))) {
|
||||
jobsService.addOneOffJob({
|
||||
name: membersMigrationJobName,
|
||||
offloaded: false,
|
||||
job: stripeService.migrations.execute.bind(stripeService.migrations)
|
||||
});
|
||||
|
||||
await jobsService.awaitCompletion(membersMigrationJobName);
|
||||
await jobsService.awaitCompletion(membersMigrationJobName);
|
||||
}
|
||||
}
|
||||
},
|
||||
contentGating: require('./content-gating'),
|
||||
|
|
Loading…
Reference in a new issue