I have restarted my PC, and my functions had stopped working and don't start running again automatically.
I mean, I have two functions that are scheduled. And they are not starting automatically after restart my PC
Is that normal behaviour?
Summary
Summary: User is experiencing an issue where their scheduled functions in Appwrite are not running automatically after restarting their PC. They are asking for advice on whether to create functions or external scripts. They also express concerns about using functions for the wrong purposes. Steven suggests using in-built database APIs and functions for other tasks. He mentions that the issue with scheduled functions might be due to Redis being cleared after restarting. Suggested solution is to update the function schedule to something else and then back to kickstart it again. Steven also mentions that Appwrite is working on improving this issue. User thanks Steven for the help.
Solution: Update the function schedule to
Drake
Feb 17, 2023, 03:06
Ya...the schedule is put in redis. It's possible that was cleared out when redis was restarted. Updating the function schedule to something else and then back should kickstart it again.
I think we're working on improving this to not rely on redis, so stay tuned!
Ponguta_
Rank 3: Container
Feb 17, 2023, 03:08
So to make it automatically, I probably need to create an script that update that, and runs on linux startup after appwrite is running?
Drake
Feb 17, 2023, 03:09
Sure ya
Ponguta_
Rank 3: Container
Feb 17, 2023, 03:10
Okay thank you.
I'm trying so hard to take advantage of all the tools that appwrite give us. (I really like the platform, and want to build everything on top of appwrite)
But sometimes functions are a bit hard.
Thank you so much Steven for all the help.
Drake
Feb 17, 2023, 03:13
Yes, we understand. That's why we're focusing on it for our next release
Ponguta_
Rank 3: Container
Feb 17, 2023, 03:15
Thank you. Do you think is a nice idea to use functions to make some logic over the appwrite databases, or should I create scripts on a separate container?
Drake
Feb 17, 2023, 03:16
I would use in built database APIs as much as possible and then try to use functions for anything else
Ponguta_
Rank 3: Container
Feb 17, 2023, 03:19
Can you elaborate a bit on that, please?
I'm worried about using functions for the wrong purposes.
Drake
Feb 17, 2023, 03:23
Haha. Generally, you need a function if you want any sort of custom logic.
There's a case where you want some fields read only but others writeable. You may not need a function for that. One way to do it is to use separate collections. a read only one and a writeable one.
Ponguta_
Rank 3: Container
Feb 17, 2023, 03:26
Oh I understand.
I'm using functions right now to create a CSV and upload it to buckets.
And another function to send some data to a remote API.
What do you think?
Ponguta_
Rank 3: Container
Feb 17, 2023, 03:28
My question is, creating functions for that is good, or should I create that as an external script?