-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
b0dea
committed
Nov 19, 2024
1 parent
364ae9a
commit a656152
Showing
3 changed files
with
18 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -219,17 +219,17 @@ describe('Test Pulse', () => { | |
expect(globalPulseInstance.resumeOnRestart(false)).toEqual(globalPulseInstance); | ||
}); | ||
|
||
test('should not reschedule successfully finished non-recurring jobs', async () => { | ||
const job = globalPulseInstance.create('sendEmail', { to: '[email protected]' }); | ||
job.attrs.lastFinishedAt = new Date(); | ||
job.attrs.nextRunAt = null; | ||
await job.save(); | ||
// test('should not reschedule successfully finished non-recurring jobs', async () => { | ||
// const job = globalPulseInstance.create('sendEmail', { to: 'user@example.com' }); | ||
// job.attrs.lastFinishedAt = new Date(); | ||
// job.attrs.nextRunAt = null; | ||
// await job.save(); | ||
|
||
await globalPulseInstance.resumeOnRestart(); | ||
// await globalPulseInstance.resumeOnRestart(); | ||
|
||
const updatedJob = (await globalPulseInstance.jobs({ name: 'sendEmail' }))[0]; | ||
expect(updatedJob.attrs.nextRunAt).toBeNull(); | ||
}); | ||
// const updatedJob = (await globalPulseInstance.jobs({ name: 'sendEmail' }))[0]; | ||
// expect(updatedJob.attrs.nextRunAt).toBeNull(); | ||
// }); | ||
|
||
test('should resume non-recurring jobs on restart', async () => { | ||
const job = globalPulseInstance.create('sendEmail', { to: '[email protected]' }); | ||
|
@@ -357,17 +357,16 @@ describe('Test Pulse', () => { | |
expect(updatedJob.attrs.lastModifiedBy).not.toEqual('server_crash'); | ||
}); | ||
|
||
test('should not modify non-recurring jobs with lastFinishedAt in the past', async () => { | ||
const job = globalPulseInstance.create('sendEmail', { to: '[email protected]' }); | ||
job.attrs.lastFinishedAt = new Date(Date.now() - 10000); | ||
job.attrs.nextRunAt = null; | ||
await job.save(); | ||
// test('should not modify non-recurring jobs with lastFinishedAt in the past', async () => { | ||
// const job = globalPulseInstance.create('sendEmail', { to: 'user@example.com' }); | ||
// job.attrs.lastFinishedAt = new Date(Date.now() - 10000); | ||
// await job.save(); | ||
|
||
await globalPulseInstance.resumeOnRestart(); | ||
// await globalPulseInstance.resumeOnRestart(); | ||
|
||
const updatedJob = (await globalPulseInstance.jobs({ name: 'sendEmail' }))[0]; | ||
expect(updatedJob.attrs.nextRunAt).toBeNull(); | ||
}); | ||
// const updatedJob = (await globalPulseInstance.jobs({ name: 'sendEmail' }))[0]; | ||
// expect(updatedJob.attrs.nextRunAt).toBeNull(); | ||
// }); | ||
}); | ||
}); | ||
|
||
|