tengine_core 0.5.31 → 0.5.32

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -58,12 +58,12 @@ GEM
58
58
  simplecov-html (~> 0.5.3)
59
59
  simplecov-html (0.5.3)
60
60
  systemu (2.4.2)
61
- tengine_event (0.4.6)
61
+ tengine_event (0.4.8)
62
62
  activesupport (>= 3.0.0)
63
63
  amqp (~> 0.8.0)
64
64
  tengine_support (>= 0.3.24)
65
65
  uuid (~> 2.3.4)
66
- tengine_support (0.3.24)
66
+ tengine_support (0.3.26)
67
67
  activesupport (>= 3.0.0)
68
68
  tzinfo (0.3.31)
69
69
  uuid (2.3.5)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.31
1
+ 0.5.32
@@ -172,19 +172,16 @@ class Tengine::Core::Kernel
172
172
 
173
173
  rescue Mongo::OperationFailure, Mongoid::Errors::Validations => e
174
174
  Tengine.logger.warn("failed to store an event.\n[#{e.class.name}] #{e.message}")
175
- # Model.exists?だと上手くいかない時があるのでModel.whereを使っています
176
- # fire_failed_event(raw_event) if Tengine::Core::Event.exists?(confitions: { key: raw_event.key, sender_name: raw_event.sender_name })
177
- fire_failed_event(raw_event) if Tengine::Core::Event.where(:key => raw_event.key, :sender_name => raw_event.sender_name).count > 0
178
- headers.ack
179
- return false
180
-
175
+ event = nil
181
176
  rescue Exception => e
182
177
  Tengine.logger.error("failed to save an event #{raw_event.inspect}\n[#{e.class.name}] #{e.message}")
183
- headers.ack
184
- return false
178
+ event = nil
185
179
  end
186
180
 
187
181
  unless event
182
+ # Model.exists?だと上手くいかない時があるのでModel.whereを使っています
183
+ # fire_failed_event(raw_event) if Tengine::Core::Event.exists?(confitions: { key: raw_event.key, sender_name: raw_event.sender_name })
184
+ fire_failed_event(raw_event) if Tengine::Core::Event.where(:key => raw_event.key, :sender_name => raw_event.sender_name).count > 0
188
185
  headers.ack
189
186
  return false
190
187
  end
@@ -381,7 +381,6 @@ describe Tengine::Core::Kernel do
381
381
  @header.stub(:ack)
382
382
  @sender = mock(:sender)
383
383
  @kernel.stub(:sender).and_return(@sender)
384
- @sender.should_not_receive(:fire)
385
384
  end
386
385
 
387
386
  shared_examples "generic heartbeats" do
@@ -504,6 +503,18 @@ describe Tengine::Core::Kernel do
504
503
  Tengine::Core::Event.where(key: e.key).count.should == 1
505
504
  Tengine::Core::Event.where(key: e.key).first.event_type_name.should =~ /expired/
506
505
  end
506
+
507
+ it "finished -> finished (失敗する)" do
508
+ EM.stub(:next_tick).and_yield
509
+ e = Tengine::Event.new key: @uuid.generate, event_type_name: "finished.process.#{kind}.tengine"
510
+ @sender.should_receive(:fire).with("finished.process.#{kind}.tengine.failed.tengined", an_instance_of(Hash))
511
+
512
+ @kernel.process_message @header, e.to_json
513
+ @kernel.process_message @header, e.to_json
514
+
515
+ Tengine::Core::Event.where(key: e.key).count.should == 1
516
+ Tengine::Core::Event.where(key: e.key).first.event_type_name.should =~ /finished/
517
+ end
507
518
  end
508
519
 
509
520
  context "異常系" do
data/tengine_core.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "tengine_core"
8
- s.version = "0.5.31"
8
+ s.version = "0.5.32"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["taigou", "totty", "g-morita", "shyouhei", "akm", "hiroshinakao"]
12
- s.date = "2012-02-16"
12
+ s.date = "2012-02-17"
13
13
  s.description = "tengine_core is a framework/engine to support distributed processing"
14
14
  s.email = "tengine@nautilus-technologies.com"
15
15
  s.executables = ["tengined", "tengine_heartbeat_watchd", "tengine_atd"]
@@ -177,7 +177,7 @@ Gem::Specification.new do |s|
177
177
  s.homepage = "http://github.com/tengine/tengine_core"
178
178
  s.licenses = ["MPL2.0/LGPLv3"]
179
179
  s.require_paths = ["lib"]
180
- s.rubygems_version = "1.8.16"
180
+ s.rubygems_version = "1.8.15"
181
181
  s.summary = "tengine_core is a framework/engine to support distributed processing"
182
182
 
183
183
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tengine_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.31
4
+ version: 0.5.32
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,11 +14,11 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2012-02-16 00:00:00.000000000Z
17
+ date: 2012-02-17 00:00:00.000000000Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: activesupport
21
- requirement: &70155971816080 !ruby/object:Gem::Requirement
21
+ requirement: &70278185546440 !ruby/object:Gem::Requirement
22
22
  none: false
23
23
  requirements:
24
24
  - - ~>
@@ -26,10 +26,10 @@ dependencies:
26
26
  version: 3.1.0
27
27
  type: :runtime
28
28
  prerelease: false
29
- version_requirements: *70155971816080
29
+ version_requirements: *70278185546440
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: activemodel
32
- requirement: &70155971815600 !ruby/object:Gem::Requirement
32
+ requirement: &70278185545960 !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
35
  - - ~>
@@ -37,10 +37,10 @@ dependencies:
37
37
  version: 3.1.0
38
38
  type: :runtime
39
39
  prerelease: false
40
- version_requirements: *70155971815600
40
+ version_requirements: *70278185545960
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: selectable_attr
43
- requirement: &70155971815120 !ruby/object:Gem::Requirement
43
+ requirement: &70278185545440 !ruby/object:Gem::Requirement
44
44
  none: false
45
45
  requirements:
46
46
  - - ~>
@@ -48,10 +48,10 @@ dependencies:
48
48
  version: 0.3.15
49
49
  type: :runtime
50
50
  prerelease: false
51
- version_requirements: *70155971815120
51
+ version_requirements: *70278185545440
52
52
  - !ruby/object:Gem::Dependency
53
53
  name: bson
54
- requirement: &70155971814640 !ruby/object:Gem::Requirement
54
+ requirement: &70278185544840 !ruby/object:Gem::Requirement
55
55
  none: false
56
56
  requirements:
57
57
  - - ~>
@@ -59,10 +59,10 @@ dependencies:
59
59
  version: 1.5.2
60
60
  type: :runtime
61
61
  prerelease: false
62
- version_requirements: *70155971814640
62
+ version_requirements: *70278185544840
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: bson_ext
65
- requirement: &70155971814160 !ruby/object:Gem::Requirement
65
+ requirement: &70278185544240 !ruby/object:Gem::Requirement
66
66
  none: false
67
67
  requirements:
68
68
  - - ~>
@@ -70,10 +70,10 @@ dependencies:
70
70
  version: 1.5.2
71
71
  type: :runtime
72
72
  prerelease: false
73
- version_requirements: *70155971814160
73
+ version_requirements: *70278185544240
74
74
  - !ruby/object:Gem::Dependency
75
75
  name: mongo
76
- requirement: &70155971813680 !ruby/object:Gem::Requirement
76
+ requirement: &70278185543640 !ruby/object:Gem::Requirement
77
77
  none: false
78
78
  requirements:
79
79
  - - ~>
@@ -81,10 +81,10 @@ dependencies:
81
81
  version: 1.5.2
82
82
  type: :runtime
83
83
  prerelease: false
84
- version_requirements: *70155971813680
84
+ version_requirements: *70278185543640
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: mongoid
87
- requirement: &70155971813200 !ruby/object:Gem::Requirement
87
+ requirement: &70278185542980 !ruby/object:Gem::Requirement
88
88
  none: false
89
89
  requirements:
90
90
  - - ~>
@@ -92,10 +92,10 @@ dependencies:
92
92
  version: 2.3.3
93
93
  type: :runtime
94
94
  prerelease: false
95
- version_requirements: *70155971813200
95
+ version_requirements: *70278185542980
96
96
  - !ruby/object:Gem::Dependency
97
97
  name: tengine_support
98
- requirement: &70155971812720 !ruby/object:Gem::Requirement
98
+ requirement: &70278185542380 !ruby/object:Gem::Requirement
99
99
  none: false
100
100
  requirements:
101
101
  - - ~>
@@ -103,10 +103,10 @@ dependencies:
103
103
  version: 0.3.12
104
104
  type: :runtime
105
105
  prerelease: false
106
- version_requirements: *70155971812720
106
+ version_requirements: *70278185542380
107
107
  - !ruby/object:Gem::Dependency
108
108
  name: tengine_event
109
- requirement: &70155971812240 !ruby/object:Gem::Requirement
109
+ requirement: &70278185541720 !ruby/object:Gem::Requirement
110
110
  none: false
111
111
  requirements:
112
112
  - - ~>
@@ -114,10 +114,10 @@ dependencies:
114
114
  version: 0.4.0
115
115
  type: :runtime
116
116
  prerelease: false
117
- version_requirements: *70155971812240
117
+ version_requirements: *70278185541720
118
118
  - !ruby/object:Gem::Dependency
119
119
  name: daemons
120
- requirement: &70155971811760 !ruby/object:Gem::Requirement
120
+ requirement: &70278185541120 !ruby/object:Gem::Requirement
121
121
  none: false
122
122
  requirements:
123
123
  - - ~>
@@ -125,10 +125,10 @@ dependencies:
125
125
  version: 1.1.4
126
126
  type: :runtime
127
127
  prerelease: false
128
- version_requirements: *70155971811760
128
+ version_requirements: *70278185541120
129
129
  - !ruby/object:Gem::Dependency
130
130
  name: rspec
131
- requirement: &70155971811280 !ruby/object:Gem::Requirement
131
+ requirement: &70278185540520 !ruby/object:Gem::Requirement
132
132
  none: false
133
133
  requirements:
134
134
  - - ~>
@@ -136,10 +136,10 @@ dependencies:
136
136
  version: 2.6.0
137
137
  type: :development
138
138
  prerelease: false
139
- version_requirements: *70155971811280
139
+ version_requirements: *70278185540520
140
140
  - !ruby/object:Gem::Dependency
141
141
  name: factory_girl
142
- requirement: &70155971810800 !ruby/object:Gem::Requirement
142
+ requirement: &70278185539920 !ruby/object:Gem::Requirement
143
143
  none: false
144
144
  requirements:
145
145
  - - ~>
@@ -147,10 +147,10 @@ dependencies:
147
147
  version: 2.1.2
148
148
  type: :development
149
149
  prerelease: false
150
- version_requirements: *70155971810800
150
+ version_requirements: *70278185539920
151
151
  - !ruby/object:Gem::Dependency
152
152
  name: yard
153
- requirement: &70155971810320 !ruby/object:Gem::Requirement
153
+ requirement: &70278185506400 !ruby/object:Gem::Requirement
154
154
  none: false
155
155
  requirements:
156
156
  - - ~>
@@ -158,10 +158,10 @@ dependencies:
158
158
  version: 0.7.2
159
159
  type: :development
160
160
  prerelease: false
161
- version_requirements: *70155971810320
161
+ version_requirements: *70278185506400
162
162
  - !ruby/object:Gem::Dependency
163
163
  name: bundler
164
- requirement: &70155971826200 !ruby/object:Gem::Requirement
164
+ requirement: &70278185505800 !ruby/object:Gem::Requirement
165
165
  none: false
166
166
  requirements:
167
167
  - - ~>
@@ -169,10 +169,10 @@ dependencies:
169
169
  version: 1.0.18
170
170
  type: :development
171
171
  prerelease: false
172
- version_requirements: *70155971826200
172
+ version_requirements: *70278185505800
173
173
  - !ruby/object:Gem::Dependency
174
174
  name: jeweler
175
- requirement: &70155971825720 !ruby/object:Gem::Requirement
175
+ requirement: &70278185505200 !ruby/object:Gem::Requirement
176
176
  none: false
177
177
  requirements:
178
178
  - - ~>
@@ -180,10 +180,10 @@ dependencies:
180
180
  version: 1.6.4
181
181
  type: :development
182
182
  prerelease: false
183
- version_requirements: *70155971825720
183
+ version_requirements: *70278185505200
184
184
  - !ruby/object:Gem::Dependency
185
185
  name: simplecov
186
- requirement: &70155971825240 !ruby/object:Gem::Requirement
186
+ requirement: &70278185504600 !ruby/object:Gem::Requirement
187
187
  none: false
188
188
  requirements:
189
189
  - - ~>
@@ -191,10 +191,10 @@ dependencies:
191
191
  version: 0.5.3
192
192
  type: :development
193
193
  prerelease: false
194
- version_requirements: *70155971825240
194
+ version_requirements: *70278185504600
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: ZenTest
197
- requirement: &70155971824760 !ruby/object:Gem::Requirement
197
+ requirement: &70278185504020 !ruby/object:Gem::Requirement
198
198
  none: false
199
199
  requirements:
200
200
  - - ~>
@@ -202,10 +202,10 @@ dependencies:
202
202
  version: 4.6.2
203
203
  type: :development
204
204
  prerelease: false
205
- version_requirements: *70155971824760
205
+ version_requirements: *70278185504020
206
206
  - !ruby/object:Gem::Dependency
207
207
  name: rdiscount
208
- requirement: &70155971824280 !ruby/object:Gem::Requirement
208
+ requirement: &70278185503460 !ruby/object:Gem::Requirement
209
209
  none: false
210
210
  requirements:
211
211
  - - ! '>='
@@ -213,10 +213,10 @@ dependencies:
213
213
  version: '0'
214
214
  type: :development
215
215
  prerelease: false
216
- version_requirements: *70155971824280
216
+ version_requirements: *70278185503460
217
217
  - !ruby/object:Gem::Dependency
218
218
  name: kramdown
219
- requirement: &70155971823800 !ruby/object:Gem::Requirement
219
+ requirement: &70278185502980 !ruby/object:Gem::Requirement
220
220
  none: false
221
221
  requirements:
222
222
  - - ! '>='
@@ -224,7 +224,7 @@ dependencies:
224
224
  version: '0'
225
225
  type: :development
226
226
  prerelease: false
227
- version_requirements: *70155971823800
227
+ version_requirements: *70278185502980
228
228
  description: tengine_core is a framework/engine to support distributed processing
229
229
  email: tengine@nautilus-technologies.com
230
230
  executables: