Back

Function schedule every minute

  • 0
  • Functions
  • Cloud
syed
10 Apr, 2024, 14:11

Hello, I have a function that runs every minute - if the function took over a minute, what happens? Does it wait for previous execution to finish first or run simultaneously execute a new one according to schedule? Still new to this! Thanks!

TL;DR
Title: Developers discussing issues with function scheduling every minute Developers discussing the behavior of a function scheduled to run every minute. Suggested fix is to adjust the interval to every 15 minutes or every hour. Mention of potential overlapping executions if previous one hasn't finished. Solution proposed to use 'setTimeout()' for testing.
Guri
10 Apr, 2024, 14:33

when a function is scheduled to run at a specific interval using a cron expression, and if the previous execution of the function hasn't finished when the next scheduled execution time comes around, the behavior depends on how you've configured your function.

Guri
10 Apr, 2024, 14:39

Like you said that your function runs every minute, it will overlap each other, it will start a new execution before ending the previous one.

it's better to schedule your cron job to every 15 minutes or every hour

syed
10 Apr, 2024, 18:38

Thanks! I guess I can always try it out with setTimeout() see how it behaves

Guri
10 Apr, 2024, 19:14

If you find the issue resolved after testing with setTimeout(), can you consider updating the title of your post to [Solved] Function Schedule Every Minute

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more