-
Notifications
You must be signed in to change notification settings - Fork 11
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
Scheduler fails to start with server when deployed on a cloud instance #38
Comments
Upon gorking the module and adding debug tracking, it looks like the line that fails is the first one from This is the real error message provided:
|
Update: I found out from App Engine docs that you cannot dynamically create files or folders except in the Problem is that on App Engine, puts all of your code in the folder // inside of Scheduler.ts
const oldSource = this.appRoot + '/tmp/adonis5-scheduler/locks' // <-- THIS WILL FAIL
const source = '/tmp/adonis5-scheduler/locks' // <-- DO THIS INSTEAD And that should set you on your way. Beyond the issueHowever after much wrestling with trying to get this working, I do not recommend others to try to use this kind of package in production. Overall CRONs do not work well when they are ran alongside your server. You also have the problem of duplicate runs. If you cloud provider replicates your instance 6 times you are likely to have 6 CRONs running in parallel. Same issue if your traffic goes down and your instance scales down to 0 over night. It is better to use your cloud provider's CRON scheduler. It will only run once at the given time and won't have the issues I've described above. Happy coding. |
I think this package should provide an option to decide where to put the The error message could also be more precise. Assuming all |
Package version
@adonis/core: 5.9.0
adonis5-scheduler: 2.1.1
Node: 20.3.1
Error Message & Stack Trace
I use the scheduler to run a CRON job on my Adonis application. Works perfectly fine locally. However, once deployed on a server, it fails with this error:
However, if I add a recursive console.log at the root of my
server.ts
, it outputs this:Something is wrong where it's unable to find a folder that in facts exists and is present.
Relevant Information
Here is the recursive print.
This is being deployed on GCP's App Engine if that is any helpful. My
app.yaml
is simple it just has envVars and the target runtime.The text was updated successfully, but these errors were encountered: