Question

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

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


Submit an answer


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!

Sign In or Sign Up to Answer

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.

Bobby Iliev
Site Moderator
Site Moderator badge
June 17, 2024

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.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more