EMILIANOM
EMILIANOM4mo ago

I saw that convex actions timeout after

I saw that convex actions timeout after 10 minutes, is there any way to bypass this limit? I need to call an API and then keep fetching for the progress (I show a progress bar in the UI) until it is completed, most of the times it justs takes 1 minute but I don’t want to lose the tasks that take longer than 10min
5 Replies
erquhart
erquhart4mo ago
Welcome! You can use the scheduler to endlessly reschedule the function: https://docs.convex.dev/scheduling/scheduled-functions
Scheduled Functions | Convex Developer Hub
Convex allows you to schedule functions to run in the future. This allows you to
erquhart
erquhart4mo ago
Haven't had to do this, but off the top of my head for your use case: - At the beginning of the action, schedule the next one to start in 10 minutes (maybe 10.5 minutes to be sure there's no accidental overlap) - If the action completes and doesn't need to be rescheduled, cancel the scheduled function
lee
lee4mo ago
it sounds like for this case you can avoid long-running actions altogether (they're expensive) - do the fetch that calls the API - schedule another action to run (in 1 second or something) to fetch the progress, and if it's not done yet this action schedules itself.
EMILIANOM
EMILIANOMOP4mo ago
thank you! 😄
erquhart
erquhart4mo ago
I did not read the use case lol, yes don’t leave the action running for polling

Did you find this page helpful?