Skip to content

Commit

Permalink
bugfix!
Browse files Browse the repository at this point in the history
  • Loading branch information
defunkt committed Apr 1, 2010
1 parent 7a9d1b2 commit 808796c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/resque/plugins/lock.rb
Expand Up @@ -44,17 +44,17 @@ module Lock
# Override in your job to control the lock key. It is
# passed the same arguments as `perform`, that is, your job's
# payload.
def self.lock(*args)
def lock(*args)
"lock:#{name}-#{args.to_s}"
end

# Convenience method, not used internally.
def self.locked?
def locked?
Resque.redis.exist(lock)
end

# Where the magic happens.
def self.around_perform_lock(*args)
def around_perform_lock(*args)
# Abort if another job has created a lock.
return unless Resque.redis.setnx(lock, true)

Expand Down

0 comments on commit 808796c

Please sign in to comment.