resque-serial 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/resque-serial/async_job.rb +4 -2
- data/lib/resque-serial/sync_job.rb +2 -0
- data/lib/resque-serial/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NWNkMTkyMGFkODliMDZkN2M5MTA4YzMzZDE0ZjZkNDc3ZDAxNjRkNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjEwOGU2NzUyNzIzY2I1ZDU3MjIwYWU5OWRkYTRhOWJkOTU5ZjNmZA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjMwMThlNzY2N2QxOWFiODM4OGZiMmM0MGNhMzRlYmZlY2Q5MTM0OTA0OTk2
|
10
|
+
YTU2MjBiYjJmOGVkMTFiZmFhZmY5YjZkMTU3YjFhMjEyYmFhYTQwOTJhM2M3
|
11
|
+
N2VmMzRlM2UwYjUzODk2YTViMzJlYTNiNTVjNTMzMjRhMDEwMGM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTgxNWZjZjRhZjU5ZDgyZWMwNTJlYTJkMGQ0YjczNjkwNTM2NmI4MTcwMmM2
|
14
|
+
OWM4YmI4YzZlOWU5Y2RmMTI0OGY5MDc0YWY0NGQxNWU0MzM1MThkZTBhMDFk
|
15
|
+
ZGVhZjc2ZjYyMmYxNmIzNjAwMGRiYmFiNTBjZDllZjVhNGRkZmQ=
|
@@ -2,7 +2,7 @@ module ResqueSerial
|
|
2
2
|
class AsyncJob
|
3
3
|
class << self
|
4
4
|
def queue
|
5
|
-
:
|
5
|
+
:sync
|
6
6
|
end
|
7
7
|
|
8
8
|
# Add a job to queue. Queue name is a class module name
|
@@ -18,7 +18,8 @@ module ResqueSerial
|
|
18
18
|
method: method,
|
19
19
|
args: args,
|
20
20
|
}
|
21
|
-
options[:scope] = target.scope.id.to_s
|
21
|
+
options[:scope] = target.scope && !target.scope.is_a?(String) ? target.scope.id.to_s : target.scope
|
22
|
+
options[:timestamp] = target.timestamp if target.timestamp
|
22
23
|
|
23
24
|
options
|
24
25
|
end
|
@@ -27,6 +28,7 @@ module ResqueSerial
|
|
27
28
|
options.symbolize_keys!
|
28
29
|
model = options[:class].constantize.unscoped.find(options[:id])
|
29
30
|
model.scope = options.delete(:scope)
|
31
|
+
model.timestamp = options.delete(:timestamp)
|
30
32
|
model.send options[:method], *options[:args]
|
31
33
|
end
|
32
34
|
end
|
@@ -29,6 +29,7 @@ module ResqueSerial
|
|
29
29
|
args: args,
|
30
30
|
}
|
31
31
|
options[:scope] = target.scope.id.to_s if target.scope
|
32
|
+
options[:timestamp] = target.timestamp if target.timestamp
|
32
33
|
|
33
34
|
Resque.redis.rpush "syncjobs:#{queue}", options.to_yaml
|
34
35
|
end
|
@@ -44,6 +45,7 @@ module ResqueSerial
|
|
44
45
|
return unless model
|
45
46
|
|
46
47
|
model.scope = options.delete(:scope)
|
48
|
+
model.timestamp = options.delete(:timestamp)
|
47
49
|
model.send options[:method], *options[:args]
|
48
50
|
end
|
49
51
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque-serial
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Kazarin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|