javan / whenever

Cron jobs in Ruby
MIT License
8.83k stars 728 forks source link

Wiki documentation for flock #793

Open jjb opened 4 years ago

jjb commented 4 years ago

I was happy to find this page: https://github.com/javan/whenever/wiki/Exclusive-cron-task-lock-with-flock

I made some changes to bring the command more in line with the built-in commands.

https://github.com/javan/whenever/wiki/Exclusive-cron-task-lock-with-flock/_compare/b92658c52b9c555cdff284c3b9bb9dcb1782e59f...fcc1264c5f5c18e3924ee8463519a6bf2a3c5a44?w=1

Also, I wrote this blog post to explore ways to achieve fair locking in a simple way (spoiler: I didn't find anything). http://code.jjb.cc/linux-flock-does-not-provide-fair-locking

Let me know what you think!

/cc @skojin

jjb commented 4 years ago

I wonder if there's any reason to not put :environment_variable=:environment on the other side of the flock invocation

skojin commented 4 years ago

looks ok