-
Notifications
You must be signed in to change notification settings - Fork 0
ecpplus/batch_lock
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
To avoid running same batch at the same time. This is useful for Rails script/runner, for example. == Usage BatchLock.run(batch_name, &block) Lock some batch. BatchLock.running?(batch_name, &block) Check some batch running? == Example begin BatchLock.run(:go_to_park) do # All users go to park! User.find(all).each(&:go_to_park) end rescue BatchLockException logger.error "already running..." end If another batch named :go_to_park is running, you can't run batch.
About
(Ruby) To avoid to run the same batch at the same time. You can use this for script/runner
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published