Report this

What is the reason for this report?

create cron job using function on app platform or standard alone function

Posted on June 17, 2024

I want to create a cronjob to do some operations in database. I tried both function on app platform and standard alone function. However, there are issues with both ways:

  1. function on app platform: cannot add “trigger” in project.yml file.
  2. standard alone function: I enabled trusted source on managed db side, but then cannot add the function to managed db trusted sources.

Does anyone have a solution for this ? thanks



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hey @senwang20240530,

Indeed this is all true as of the time being.

It looks like someone has had the same idea before and has posted it on our Product Ideas board. The best thing to do would be to head over and add your vote to it, as well as adding any additional information in the comments for exactly what you’d like to see implemented!

https://ideas.digitalocean.com/app-platform/p/add-support-to-configure-cron-job

What you could do in the meantime, is to check out this article here on How To Setup a Job Scheduler on the DigitalOcean App Platform:

https://docs.digitalocean.com/developer-center/how-to-setup-a-job-scheduler-on-digitalocean-app-platform/

It essentially spins up an additional container where you could define your scheduled curl requests in.

- Bobby.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.