kabbouchi / adonisjs-scheduler Goto Github PK
View Code? Open in Web Editor NEWTask scheduler for AdonisJS
License: MIT License
Task scheduler for AdonisJS
License: MIT License
How do you start the cronjob with pm2 in production?
this looks very similar to laravel schedule. when you think it will be in stable form ?
I want to adjust parameters programmatically and run and stop the scheduler at (environment: ['web'])
Every time when i start scheduler node ace scheduler:run
i see errors
(node:2572) UnhandledPromiseRejectionWarning: GrammyError: Call to 'getUpdates' failed! (409: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running)
i have a socket service launching inside a provider
I see that it starts also for the instance created for the scheduler
how can I detect that the app is launched by scheduler in order to disable socket service?
(node:26570) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGTERM listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
(node:26570) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 uncaughtExceptionMonitor listeners added to [process]. Use emitter.setMaxListeners() to increase limit
I have this warning on the very simple test job:
public async run() {
this.logger.info('temp task')
}
import Scheduler from '@ioc:Adonis/Addons/Scheduler'
Scheduler.command('temp').everyFiveSeconds()
After several tasks completed. And no warnings after that.
[ info ] Schedule worker started successfully.
[ info ] temp task
[ info ] temp task
[ info ] temp task
[ info ] temp task
[ info ] temp task
[ info ] temp task
[ info ] temp task
[ info ] temp task
[ info ] temp task
[ info ] temp task
(node:10) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGTERM listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
(node:10) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 uncaughtExceptionMonitor listeners added to [process]. Use emitter.setMaxListeners() to increase limit
[ info ] temp task
[ info ] temp task
[ info ] temp task
[ info ] temp task
I have the following ecosystem.config.cjs
module.exports = {
apps: [
{
name: 'spins-scheduler-dev',
script: 'ace scheduler:run',
instances: 'max',
exec_mode: 'cluster',
autorestart: true,
env: {
ENV_PATH: '/var/github-actions/built-files/spins-api-dev/env-files/dev',
},
},
],
}
if I go into pm2 logs, I get this error, on loop
9|spins-scheduler-dev | /usr/bin/bash:1
9|spins-scheduler-dev | �ELF
9|spins-scheduler-dev | ^
9|spins-scheduler-dev | SyntaxError: Invalid or unexpected token
9|spins-scheduler-dev | at internalCompileFunction (node:internal/vm:77:18)
9|spins-scheduler-dev | at wrapSafe (node:internal/modules/cjs/loader:1290:20)
9|spins-scheduler-dev | at Module._compile (node:internal/modules/cjs/loader:1342:27)
9|spins-scheduler-dev | at Module._extensions..js (node:internal/modules/cjs/loader:1437:10)
9|spins-scheduler-dev | at Module.load (node:internal/modules/cjs/loader:1212:32)
9|spins-scheduler-dev | at Module._load (node:internal/modules/cjs/loader:1028:12)
9|spins-scheduler-dev | at /usr/local/lib/node_modules/pm2/lib/ProcessContainer.js:304:25
9|spins-scheduler-dev | at wrapper (/usr/local/lib/node_modules/pm2/node_modules/async/internal/once.js:12:16)
9|spins-scheduler-dev | at next (/usr/local/lib/node_modules/pm2/node_modules/async/waterfall.js:96:20)
9|spins-scheduler-dev | at /usr/local/lib/node_modules/pm2/node_modules/async/internal/onlyOnce.js:12:16
app is started by
pm2 start ecosystem.config.cjs --only "spins-scheduler-dev"
adonis v6
node v21.6.1
This is more of a request for help, than an issue
I have the main app running with a socket.io server opened using this guide: https://v5-docs.adonisjs.com/cookbooks/socketio-with-adonisjs
Inside the scheduler, I need to notify the socket.io server in order to emit events to the clients connected to the main app.
Does anyone know any way I can do that? How can I communicate with the running adonis server from within the scheduler
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.