oldmoe / litestack

MIT License
1.02k stars 56 forks source link

[Question] Is it possible to add support for Recurring Tasks? #101

Open weizheheng opened 5 months ago

weizheheng commented 5 months ago

First of all, thank you very much for the gem. I am using it for my personal project and hosting it on Fly.io with LiteFS just works.

I am not very familiar with how all these works together, so please bear with me if the question sounds stupid.

One thing I am missing now with the setup is the ability to be able to run cron jobs. I see SolidQueue recently merged in Recurring tasks which was inspired by GoodJob's cron manager, and I am wondering if it's possible to have something like that in Litejob?

What I have looked into:

  1. Try out solid queue with Fly.io + LiteFS, but I just couldn't set it up. There weren't many resources out there so I gave up.
  2. Setting up cron on Fly.io, there are a few suggestions on scheduled machine and Crontab with Supercronic, but those require extra machine.
misterhtmlcss commented 5 months ago

This is probably not helpful, but I thought why not consider it depending on your openness to self resolution on this point.

  1. Create a recursive job? Look at how fugit is used and the litejob gem and guide and see what can be done to tweak it to work for you?

  2. A free cron job service: https://cron-job.org/ or another one as this is not a recommendation only an illustration.

weizheheng commented 5 months ago

This is probably not helpful, but I thought why not consider it depending on your openness to self resolution on this point.

  1. Create a recursive job? Look at how fugit is used and the litejob gem and guide and see what can be done to tweak it to work for you?
  2. A free cron job service: https://cron-job.org/ or another one as this is not a recommendation only an illustration.

Thanks for the suggestion. I did spend some time looking around for alternative, and this is more of a general question on whether it's feasible or not since I am not really well-versed in sqlite3.

Found a reddit comment from the author and it seems like it's possible. With that in mind, I will explore more on adding support to litestack.

I am asking this question in litestack because the goal of litestack is to be a all-in-one solution for web application data infrastructure and having support for cron jobs is definitely a good addition.

oldmoe commented 4 months ago

Support is definitely possible, it will require a few changes to the schema and I want to do that after I implement more durable execution (where jobs are not removed from the queue until after execution completes). Which will interfere with this particular feature