Skip to content
New issue

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

How to use this package in the real world #4

Open
Barbapapazes opened this issue Jul 25, 2022 · 4 comments
Open

How to use this package in the real world #4

Barbapapazes opened this issue Jul 25, 2022 · 4 comments
Assignees
Labels

Comments

@Barbapapazes
Copy link

Barbapapazes commented Jul 25, 2022

Hello,

I'm trying to run some cron actions. These actions a super simple, it's just a trigger of a command build using ace.

First, I do not know if i should use crontab from linux, a package like adonis5-schedule or this package.

I've tried adonis5-schedule and I do not know how to use it in production (i.e.: how to stop jobs when reploying my application.
For this package, I can use the feature repeat from bull-mq but how to setup these in Adonis? I tried a prldfile but each time the server wake up, a new worker is created which is not what I want and I do not know how to manage this in production? Should I run node ace queue:listen using pm2? That's hard to understand the purpose of this package and the problem solved.

So I think crontab is the best solution actually?

Laravel have a tasks scheduler with a lot of feature and documentation. Could we expect the same with Adonis6?

@RomainLanz RomainLanz self-assigned this Aug 8, 2022
@Barbapapazes

This comment was marked as outdated.

@Barbapapazes

This comment was marked as outdated.

@Barbapapazes Barbapapazes changed the title Can you provide exemples ? How to use this package in the real world Dec 13, 2023
@Barbapapazes
Copy link
Author

Hello @RomainLanz, I've updated my issue. I've tried this package for a real world application and I've now a lot of question.

@FaiezWaseem7
Copy link

In my server package.json i added something like this

"scripts": {
"start": "node bin/server.js",
"build": "node ace build",
"listen" : "node ace queue:listen",
"dev": "node ace serve --hmr",
"test": "node ace test",
"lint": "eslint .",
"format": "prettier --write .",
"typecheck": "tsc --noEmit"
},

and then ran the command from pm2 to run listen

pm2 start npm --name "job-listener" -- run listen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants