By robbarber
I’m trying to make code that will run one method in my App Platform Django project every 15 minutes. According to the D.O. docs a Worker resource can do this.
However, after scouring the internet for hours I can’t find any documentation about how this code is run, if it needs to be it’s own python process, how the worker is configured or any other basic information on how these are supposed to work.
Ideally I can just say “run this method” on my existing App Platform app and be done with it. If needed I’m fine with sending a network request to start the method (without a response according to the Worker documentation).
I just need somewhere to start. I have no idea how to code something the worker can even use.
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!
Hi there,
Background workers can consist of any application code you like. As far as App Platform is concerned, they are the same as services, except they are not “routable,” i.e. they are not accessible via an external URL.
It sounds like for your use case, it might be better to use a serverless function and schedule it so it runs on specific times:
https://docs.digitalocean.com/products/functions/how-to/schedule-functions/
Best,
Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.