sad 1.5.17 → 1.5.18

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.
data/README.md CHANGED
@@ -71,9 +71,9 @@ Sad::Config.namespace = 'MyBackgroundJobQueue'
71
71
  查看是否有sad的rake任务:
72
72
 
73
73
  saimatoMacBook-Pro:rca.imdb cuizheng$ bundle exec rake -T
74
- rake sad:restart # restart sad with args - COUNT=4 QUEUE=sosad DIR=./tmp/pids
75
- rake sad:start # start sad with args - COUNT=4 QUEUE=sosad DIR=./tmp/pids
76
- rake sad:stop # stop sad with args - COUNT=4 QUEUE=sosad DIR=./tmp/pids
74
+ rake sad:restart # restart sad with args - COUNT=4 QUEUE=sosad INTERVAL=2 DIR=./tmp/pids
75
+ rake sad:start # start sad with args - COUNT=4 QUEUE=sosad INTERVAL=2 DIR=./tmp/pids
76
+ rake sad:stop # stop sad with args - COUNT=4 QUEUE=sosad INTERVAL=2 DIR=./tmp/pids
77
77
 
78
78
  启动:`bundle exec rake sad:start COUNT=2 QUEUE=sosad DIR=./tmp/pids`
79
79
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.5.17
1
+ 1.5.18
@@ -11,7 +11,10 @@ module Sad
11
11
  'retry' => 0,
12
12
  'delay' => 0
13
13
  }.update(sad_args)
14
- self.redis ||= ::Sad::Config.redis
14
+ end
15
+
16
+ def redis
17
+ @redis ||= ::Sad::Config.redis
15
18
  end
16
19
 
17
20
  def encode
@@ -22,6 +22,9 @@ module Sad
22
22
  if count and count != 0
23
23
  count.times do |t|
24
24
  Daemons.run_proc("Sad-#{Sad::Config.queue(ENV['QUEUE'])}-#{t+1}", opts) do
25
+ # set interval
26
+ ::Sad::Config.interval = ENV['INTERVAL'].to_f if ENV['INTERVAL']
27
+
25
28
  self.require_libs
26
29
  self.show_info
27
30
  ::Sad.logger.reopen
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "sad"
8
- s.version = "1.5.17"
8
+ s.version = "1.5.18"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["\u{5d14}\u{5ce5}"]
12
- s.date = "2013-08-09"
12
+ s.date = "2013-09-11"
13
13
  s.description = "a simple em baseed background job worker."
14
14
  s.email = "zheng.cuizh@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -46,7 +46,7 @@ Gem::Specification.new do |s|
46
46
  s.homepage = "http://github.com/charlescui/sad"
47
47
  s.licenses = ["MIT"]
48
48
  s.require_paths = ["lib"]
49
- s.rubygems_version = "1.8.24"
49
+ s.rubygems_version = "1.8.25"
50
50
  s.summary = "a simple em baseed background job worker."
51
51
 
52
52
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sad
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.17
4
+ version: 1.5.18
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-09 00:00:00.000000000 Z
12
+ date: 2013-09-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jeweler
@@ -203,7 +203,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
203
203
  version: '0'
204
204
  segments:
205
205
  - 0
206
- hash: -1921166889623153547
206
+ hash: 568116817287952267
207
207
  required_rubygems_version: !ruby/object:Gem::Requirement
208
208
  none: false
209
209
  requirements:
@@ -212,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
212
212
  version: '0'
213
213
  requirements: []
214
214
  rubyforge_project:
215
- rubygems_version: 1.8.24
215
+ rubygems_version: 1.8.25
216
216
  signing_key:
217
217
  specification_version: 3
218
218
  summary: a simple em baseed background job worker.