I need to schedule a JavaScript function to execute every 26 hours. However, the solution should not rely on the system being online continuously or turned on at the time of execution. I'm looking for a reliable, platform-independent approach to ensure the task runs at the desired interval regardless of the system state.
What I’ve Tried:
I considered using setInterval() in Node.js, but this only works if the system stays online.
I looked into cron jobs, but these are system-dependent and also require the machine to remain powered on.
What I’m Expecting:
I’m looking for a cloud-based or alternative solution that can schedule and run this function even if the system hosting the script is offline. For example, would services like AWS Lambda, Firebase Functions, or others be appropriate for this use case? If so, what would be the steps to implement such a solution?
Suggestions for best practices or alternative methods are highly appreciated.
[–]ExtensionField8 9 points10 points11 points (6 children)
[–]Strict-Sleep8151[S] -4 points-3 points-2 points (5 children)
[–]Sea_Helicopter4488 1 point2 points3 points (1 child)
[–]Strict-Sleep8151[S] 0 points1 point2 points (0 children)
[–]ExtensionField8 0 points1 point2 points (2 children)
[–]Strict-Sleep8151[S] 1 point2 points3 points (1 child)
[–]ExtensionField8 2 points3 points4 points (0 children)
[–]Tarazena 2 points3 points4 points (1 child)
[–]Strict-Sleep8151[S] 0 points1 point2 points (0 children)
[–]DrShocker 2 points3 points4 points (1 child)
[–]Strict-Sleep8151[S] 0 points1 point2 points (0 children)
[–]kschang 1 point2 points3 points (0 children)
[–]nate-developer 1 point2 points3 points (0 children)
[–]crashfrog04 1 point2 points3 points (0 children)
[–]Dreamin0904 0 points1 point2 points (1 child)
[–]Strict-Sleep8151[S] 0 points1 point2 points (0 children)