delayed_job_mongoid 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/delayed/backend/mongoid.rb +5 -10
  2. metadata +9 -9
@@ -42,16 +42,11 @@ module Delayed
42
42
  (conditions[:priority] ||= {})['$gte'] = Worker.min_priority.to_i if Worker.min_priority
43
43
  (conditions[:priority] ||= {})['$lte'] = Worker.max_priority.to_i if Worker.max_priority
44
44
 
45
- if ::Mongoid.master.connection.server_version < '1.5.3'
46
- lock_time = "new Date(#{(right_now - max_run_time).to_f * 1000})"
47
- conditions['$where'] = "this.locked_by == '#{worker.name}' || this.locked_at == null || this.locked_at < #{lock_time}"
48
- else
49
- conditions['$or'] = [
50
- { :locked_by => worker.name },
51
- { :locked_at => nil },
52
- { :locked_at => { '$lt' => (right_now - max_run_time) }}
53
- ]
54
- end
45
+ conditions['$or'] = [
46
+ { :locked_by => worker.name },
47
+ { :locked_at => nil },
48
+ { :locked_at => { '$lt' => (right_now - max_run_time) }}
49
+ ]
55
50
 
56
51
  begin
57
52
  result = self.db.collection(self.collection.name).find_and_modify(
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delayed_job_mongoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ date: 2011-08-23 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: mongoid
17
- requirement: &70138573630740 !ruby/object:Gem::Requirement
17
+ requirement: &70295558175360 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '2.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70138573630740
25
+ version_requirements: *70295558175360
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: delayed_job
28
- requirement: &70138573629120 !ruby/object:Gem::Requirement
28
+ requirement: &70295558138700 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 2.1.1
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *70138573629120
36
+ version_requirements: *70295558138700
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: rspec
39
- requirement: &70138573627340 !ruby/object:Gem::Requirement
39
+ requirement: &70295558137480 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,7 +44,7 @@ dependencies:
44
44
  version: '2.0'
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *70138573627340
47
+ version_requirements: *70295558137480
48
48
  description:
49
49
  email:
50
50
  - chris@collectiveidea.com
@@ -78,7 +78,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
78
78
  version: '0'
79
79
  segments:
80
80
  - 0
81
- hash: -1827327397423987643
81
+ hash: -4466304754731282186
82
82
  required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  version: '0'
88
88
  segments:
89
89
  - 0
90
- hash: -1827327397423987643
90
+ hash: -4466304754731282186
91
91
  requirements: []
92
92
  rubyforge_project:
93
93
  rubygems_version: 1.8.6