run tasks on a specific day of the week
tonyvince opened this issue · comments
Tony Vincent commented
Is there a way that I can run tasks on a specific day of the week, say every Tuesday?
I have been using the whenever gem and it has a nice option to do that
every :sunday, :at => '12pm' do # Use any day of the week or :weekend, :weekday
runner "Task.do_something_great"
end
Hugo Abonizio commented
Hi @tonyvince, thank you for the suggestion!
I think it's a nice feature and have plans to implement it sometime, but if you want to tackle on this, feel free to send a PR! 😄
Hugo Abonizio commented
@tonyvince There's a new release that includes this feature, do you wanna take a look? 😃
Now it's possible to do things like this:
Schedule.every(:day, "16:00:00") do
puts "Good Afternoon!"
end
And use days of the week, as you suggested:
Schedule.every(:sunday, "16:00:00") do
puts "House Keeping"
end