Closed exzachlyvv closed 1 month ago
Hey @exzachlyvv We are not supporting Cron or the scheduler. you can trigger the a task with your preferred operation
@exzachlyvv with rails, historically, there were 3 ways to run scheduled jobs:
schedule "every 2 weeks" do
# some code
end
Which technique would you be referring to?
Any of these would work :)
My use case is simply that I need to run some code every X minutes. There are no requirements for a specific API.
Is this functionally Loco is interested in supporting (happy to help with it)? If yes, we can continue to discuss the ideal design for loco.
Simple idea: expose some endpoint /run-my-task and have an external service ping it every X minutes.
But ideally Loco can solve this problem :)
Loco depends on sidekiq-rs which support Periodic Jobs. Maybe loco can expose the worker process in hooks(something like after_boot?) to support this?
@ShallmentMo that's a great idea. I'm wondering how to integrate that seamlessly. On the face of it it looks like a "forever-running" await
and so it needs a dedicated thread or process. So, if we create a Loco task
and tell the user: "run this task in any way you like, it will hang and run the periodic jobs" it might work. On the other hand it will be 1 more extra process.
I'd welcome more ideas to satisfy: minimum user friction, and minimum resources neeed
I don't know wether it might help or not. But I use sidekiq-cron to support cron job when using Rails and Sidekiq
Hey @exzachlyvv, I just started to implement this feature: #735.
It will be great to get your feedback.
Released in version 0.9.0
First off, THANK YOU for loco.rs :)
I've been looking for a Rails/Laravel equivalent in Rust for a while.
Is there a plan to add a cron/scheduler system?
Laravels API is incredible and could be inspired.