Git Product home page Git Product logo

adonisjs-scheduler's People

Contributors

kabbouchi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

adonisjs-scheduler's Issues

Erron warnings when using scheduler with GrammyJS/TelegrafJS

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)

how to detect scheduler app

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?

MaxListenersExceededWarning

(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

Cannot start in production using pm2

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

Communicate with main app

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.