Permalink
Browse files

Knew I'd forget to rename something!

  • Loading branch information...
1 parent 6ee767e commit a9214957baef0cfdcd457e2707d60b7f24eef459 @lantins committed May 5, 2010
Showing with 13 additions and 10 deletions.
  1. +1 −0 LICENSE
  2. +1 −1 lib/resque-lock-timeout.rb
  3. +5 −3 lib/resque/plugins/{lock.rb → lock_timeout.rb}
  4. +1 −1 test/lock_test.rb
  5. +5 −5 test/test_jobs.rb
View
@@ -1,5 +1,6 @@
Copyright (c) 2010 Chris Wanstrath
Copyright (c) 2010 Ryan Carver
+Copyright (c) 2010 Luke Antins
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -1 +1 @@
-require 'resque/plugins/lock'
+require 'resque/plugins/lock_timeout'
@@ -6,7 +6,8 @@ module Plugins
# require 'resque-lock'
#
# class UpdateNetworkGraph
- # extend Resque::Plugins::Lock
+ # extend Resque::Plugins::LockTimeout
+ # @queue = :network_graph
#
# def self.perform(repo_id)
# heavy_lifting
@@ -17,7 +18,8 @@ module Plugins
# set/override `lock_timeout`. e.g.
#
# class UpdateNetworkGraph
- # extend Resque::Plugins::Lock
+ # extend Resque::Plugins::LockTimeout
+ # @queue = :network_graph
#
# # lock may be held for upto an hour.
# @lock_timeout = 3600
@@ -27,7 +29,7 @@ module Plugins
# end
# end
#
- module Lock
+ module LockTimeout
# @abstract You may override to implement a custom identifier,
# you should consider doing this if your job arguments
# are many/long or may not cleanly cleanly to strings.
View
@@ -9,7 +9,7 @@ def setup
def test_lint
assert_nothing_raised do
- Resque::Plugin.lint(Resque::Plugins::Lock)
+ Resque::Plugin.lint(Resque::Plugins::LockTimeout)
end
end
View
@@ -1,5 +1,5 @@
class SlowJob
- extend Resque::Plugins::Lock
+ extend Resque::Plugins::LockTimeout
@queue = :test
def self.perform
@@ -13,7 +13,7 @@ def self.lock_failed(*args)
end
class FastJob
- extend Resque::Plugins::Lock
+ extend Resque::Plugins::LockTimeout
@queue = :test
def self.perform
@@ -26,7 +26,7 @@ def self.lock_failed(*args)
end
class FailingFastJob
- extend Resque::Plugins::Lock
+ extend Resque::Plugins::LockTimeout
@queue = :test
def self.perform
@@ -36,7 +36,7 @@ def self.perform
end
class SlowWithTimeoutJob
- extend Resque::Plugins::Lock
+ extend Resque::Plugins::LockTimeout
@queue = :test
@lock_timeout = 60
@@ -47,7 +47,7 @@ def self.perform
end
class ExpireBeforeReleaseJob
- extend Resque::Plugins::Lock
+ extend Resque::Plugins::LockTimeout
@queue = :test
@lock_timeout = 1

0 comments on commit a921495

Please sign in to comment.