-
I have some background tasks I want to run on a regular basis to sync data when users authenticate with my application. For testing purposes, its currently implemented as a goroutine that's started in the auth endpoint, but that's not working great. I tried to check the source code to see if there was a way to start some routine when a service starts so it could do things like poll a database for tasks to run, but I couldn't find anything. Is there any way at the moment to hook into a service's main function to start a go routine or to run an async loop of some kind? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @Minivera, great question! We’re going to add much better support for background tasks, cron jobs, and so on. Right now the best solution tends to be to implement a cron job outside of Encore that pings an endpoint on a regular basis. Is that something that would work for your use case? It would be very useful to understand more about what you’re trying to do :) |
Beta Was this translation helpful? Give feedback.
Hey @Minivera, great question! We’re going to add much better support for background tasks, cron jobs, and so on. Right now the best solution tends to be to implement a cron job outside of Encore that pings an endpoint on a regular basis. Is that something that would work for your use case? It would be very useful to understand more about what you’re trying to do :)