rbbt-rest 1.8.12 → 1.8.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 39ec6a4d18a8f038d1dcde6def73cef597cfd233
4
- data.tar.gz: 7300356f3b3d2dcfcb3fd0aed05e808942ae9fce
3
+ metadata.gz: b04163cbc85792c0d0051c0db5a1d0fe660cccab
4
+ data.tar.gz: 1dbc02c47f8557a8cdc5344fda9cb1fd638591ea
5
5
  SHA512:
6
- metadata.gz: 750cc3ac0961111b9fc2526f7ae7e51d9b84801074e41fd29582efcda8685b7cc0f8cd3f519ee1fd180080984962873a98d3f536ed58f280e6089d8b1655bb8f
7
- data.tar.gz: b6f74f3669ce861c26c105b4f02a66a48b93b6a878e1a60292cefb87132266bdb7307ba00c05e11ced05767db8f2c9afa13803f82d9bad83b767677f44bd7b6a
6
+ metadata.gz: 2e4d467e0a73c5b785ffc323b82623ffaa483b8ac816caeaac349ff38b12098be3714952da97507d7a6ae3d107a5eafc82336e83baba21ddeb3ff1849f7a08da
7
+ data.tar.gz: e6d983292f0703baddc62e5279fea29f0077c49d2e485d056dce53769d2583980cf995cde5557f5355b8434d06156b559006cee5a22b6721fcbce65e38e21d3e
@@ -155,6 +155,8 @@ module WorkflowRESTHelpers
155
155
  job.soft_grace
156
156
  end
157
157
 
158
+ raise job.messages.last if job.error?
159
+
158
160
  s = TSV.get_stream job
159
161
 
160
162
  sout, sin = Misc.pipe
@@ -83,9 +83,14 @@ class StreamWorkflowTask
83
83
  Misc.add_stream_filename(stream, filename) if filename
84
84
 
85
85
  clean_stream = Misc.open_pipe do |sin|
86
- copy_until_boundary(stream, sin, boundary)
86
+ begin
87
+ copy_until_boundary(stream, sin, boundary)
88
+ rescue
89
+ end
87
90
  end
88
91
 
92
+ ConcurrentStream.setup(clean_stream, :filename => filename)
93
+
89
94
  task_parameters[stream_input] = clean_stream
90
95
 
91
96
  task = task.to_sym
@@ -196,14 +201,20 @@ class StreamWorkflowTask
196
201
 
197
202
  def do_stream(env)
198
203
  uri = env["REQUEST_URI"]
204
+
199
205
  post = env["REQUEST_METHOD"]
206
+ return false unless post == "POST"
207
+
200
208
  hijack = !!env["rack.hijack"]
209
+ return false unless hijack
210
+
201
211
  content_type = env["CONTENT_TYPE"]
212
+ return false unless content_type and content_type.include? "Rbbt_Param_Stream"
213
+
202
214
  encoding = env["HTTP_TRANSFER_ENCODING"]
203
- id = env["HTTP_RBBT_ID"]
204
- id = id + ": " + Thread.current.object_id.to_s if id
215
+ return false unless encoding == "chunked"
205
216
 
206
- post == "POST" and hijack and content_type and content_type.include? "Rbbt_Param_Stream" and encoding == 'chunked'
217
+ true
207
218
  end
208
219
 
209
220
  def call(env)
@@ -214,12 +225,13 @@ class StreamWorkflowTask
214
225
  client = env["rack.hijack"]
215
226
  buffer = client.instance_variable_get('@buffer')
216
227
  tcp_io = client.call
217
- Log.low "YES Hijacking post data #{tcp_io}"
228
+ Log.low "Hijacking post data #{tcp_io}"
218
229
 
219
230
  content_type = env["CONTENT_TYPE"]
220
231
 
221
232
  tcp_merged_io = Misc.open_pipe do |sin| merge_chunks(tcp_io, sin, buffer) end
222
233
 
234
+
223
235
  inputs, stream_input, filename, stream, boundary = get_inputs(content_type, tcp_merged_io)
224
236
 
225
237
  workflow, task = parse_uri(env)
@@ -228,6 +240,9 @@ class StreamWorkflowTask
228
240
 
229
241
  job_url = File.join("/", workflow.to_s, task, job.name)
230
242
 
243
+ raise "Job aborted" if job.aborted?
244
+ raise job.messages.last if job.error?
245
+
231
246
  out_stream = TSV.get_stream job
232
247
 
233
248
  begin
@@ -256,7 +271,7 @@ class StreamWorkflowTask
256
271
  raise $!
257
272
  end
258
273
  else
259
- Log.high "NOT Hijacking post data"
274
+ Log.low "NOT Hijacking post data"
260
275
 
261
276
  @app.call(env)
262
277
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.12
4
+ version: 1.8.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-07 00:00:00.000000000 Z
11
+ date: 2016-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake