We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example test to reproduce
describe('Mulitple Cron', () => { it('run cronjobs', async () => { let done1 = false let done2 = false new Elysia().use( cron({ pattern: '*/1 * * * * *', name: 'job_1', run() { done1 = true } }) ).use( cron({ pattern: '*/1 * * * * *', name: 'job_2', run() { done2 = true } }) ) await new Promise((resolve) => setTimeout(resolve, 1100)) expect(done1).toBe(true) expect(done2).toBe(true) }) it('stop cronjobs', async () => { let done1 = false let done2 = false const app = new Elysia() .use( cron({ pattern: '*/1 * * * * *', name: 'job_1', run() { done1 = true } }) ).use( cron({ pattern: '*/1 * * * * *', name: 'job_2', run() { done2 = true } }) ) .get('/stop', ({ store }) => { store.cron.job_1.stop() store.cron.job_2.stop() return 'stop' }) await app.handle(req('/stop')) expect(done1).toBe(false) expect(done2).toBe(false) }) })
results in error: TypeError: undefined is not an object (evaluating 'store.cron.job_2.stop')
TypeError: undefined is not an object (evaluating 'store.cron.job_2.stop')
The text was updated successfully, but these errors were encountered:
First test passes, second test fails. In second test, job_1 is successfully stopped
job_1
Sorry, something went wrong.
Root cause found: multiple calls to app.state('key', 'value') do not update the value of the key
app.state('key', 'value')
key
No branches or pull requests
Example test to reproduce
results in error:
TypeError: undefined is not an object (evaluating 'store.cron.job_2.stop')
The text was updated successfully, but these errors were encountered: