Scheduled action: database update

@George this is amazing, and perfect for handling some of our apps features. I hadn’t gone near cron jobs yet, so this can hopefully avoid that.

Quick question, will this work on Docker Local environment? I’ve tried a test scheduler, to set a DB Field value of 50 every 10 seconds, but nothing is happening so wondered if this won’t work locally? How can we debug the scheduler?

Investigated further, I set an email action on the same 10 second scheduler test - and that worked fine, it just won’t update the DB field. Any ideas why that might be? I’ve checked all the fields and conditions are correct.

did you check server logs ?

Good idea. Here is what I’m getting when I’m solely trying to update the one field:

(node:129) UnhandledPromiseRejectionWarning: TypeError: this.res.on is not a function

at App.setDbConnection (/opt/node_app/lib/core/app.js:236:18)

at App.getDbConnection (/opt/node_app/lib/core/app.js:252:25)

at App.update (/opt/node_app/lib/modules/dbupdater.js:39:25)

at App._exec (/opt/node_app/lib/core/app.js:417:57)

at App.exec (/opt/node_app/lib/core/app.js:357:20)

at App.define (/opt/node_app/lib/core/app.js:347:20)

at Job.job (/opt/node_app/lib/setup/cron.js:37:20)

at Job.invoke (/opt/node_app/node_modules/node-schedule/lib/schedule.js:173:10)

at /opt/node_app/node_modules/node-schedule/lib/schedule.js:552:11

at Timeout._onTimeout (/opt/node_app/node_modules/node-schedule/lib/schedule.js:510:7)

(node:129) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag –unhandled-rejections=strict (see (rejection id: 14)

Hey @Teodor or @patrick Should these be able to work with Global’s (such as an S3 provider) and also the new Library include action?

I have tried to test it out with downloading a CSV then uploading that file to an S3 bucket but its not working. The API works fine as a stand-alone API in server connect, but when I copied over all the exec steps into the the Schedule step, it doesn’t appear to work.

I’ll be working on a fix, will post it here as soon as possible.

1 Like

Thank you @patrick!

You may test following update, unzip in lib/core. (3.7 KB)

Confirmed as working, thank you!

Hey @patrick

Not sure if this worked or not but i fixed my issue. Something you can look into:

It turns out in the server logs (in Docker) i noticed it was not adding the schedule JSON file at the end of the logs.

This was because by schedule JSON file was inside a FOLDER.

Once I moved it out of the folder into the root Schedule directory it added it to the schedule list in the server logs and executed it right away.

1 Like

This has been fixed in Wappler 3.5.7

1 Like

This topic was automatically closed after 47 hours. New replies are no longer allowed.