Back

Scheduled functions doesn't run automatically after restarting PC

  • 0
  • Functions
Ponguta_
17 Feb, 2023, 02:54

Hello again, sorry if it is a noob question, but:

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?

TL;DR
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
17 Feb, 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_
17 Feb, 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
17 Feb, 2023, 03:09

Sure ya

Ponguta_
17 Feb, 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
17 Feb, 2023, 03:13

Yes, we understand. That's why we're focusing on it for our next release

Ponguta_
17 Feb, 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
17 Feb, 2023, 03:16

I would use in built database APIs as much as possible and then try to use functions for anything else

Ponguta_
17 Feb, 2023, 03:19

Can you elaborate a bit on that, please?

I'm worried about using functions for the wrong purposes.

Drake
17 Feb, 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_
17 Feb, 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_
17 Feb, 2023, 03:28

My question is, creating functions for that is good, or should I create that as an external script?

Drake
17 Feb, 2023, 04:15

Function is fine

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