bricolage-streamingload 0.14.0 → 0.14.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba544bbf6c3a133aeb0882e5193296dc734a25ec
|
4
|
+
data.tar.gz: 8706c5cd050e1083075d2890e422e3834680c2ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d03f41030b3c7bc7175c1abf7b2f6e8e5c3a40c3cff5754e678c76338190b9c0293792dc4a8cc34fbf262419ac054467503c823ceafc2a55a6e59d9a2762f937
|
7
|
+
data.tar.gz: 8bd7c0cc4b826383d552ed196581b00a8d33010e24ada2cb9f3eb76ed381178b35e706585a2da449d019bf8bd4e43233afc84902695382df152925261d3fb848
|
@@ -63,6 +63,11 @@ module Bricolage
|
|
63
63
|
logger: logger
|
64
64
|
)
|
65
65
|
|
66
|
+
if opts.task_id
|
67
|
+
dispatcher.dispatch_tasks chunk_buffer.load_tasks_by_id([opts.task_id])
|
68
|
+
exit 0
|
69
|
+
end
|
70
|
+
|
66
71
|
Process.daemon(true) if opts.daemon?
|
67
72
|
create_pid_file opts.pid_file_path if opts.pid_file_path
|
68
73
|
Dir.chdir '/'
|
@@ -219,6 +224,7 @@ module Bricolage
|
|
219
224
|
@daemon = false
|
220
225
|
@log_file_path = nil
|
221
226
|
@pid_file_path = nil
|
227
|
+
@task_id = nil
|
222
228
|
@rest_arguments = nil
|
223
229
|
|
224
230
|
@opts = opts = OptionParser.new("Usage: #{$0} CONFIG_PATH")
|
@@ -234,6 +240,9 @@ module Bricolage
|
|
234
240
|
opts.on('--pid-file=PATH', 'Creates PID file.') {|path|
|
235
241
|
@pid_file_path = path
|
236
242
|
}
|
243
|
+
opts.on('--task-id=ID', 'Dispatches this task and quit.') {|id|
|
244
|
+
@task_id = id.to_i
|
245
|
+
}
|
237
246
|
opts.on('--help', 'Prints this message and quit.') {
|
238
247
|
puts opts.help
|
239
248
|
exit 0
|
@@ -263,6 +272,8 @@ module Bricolage
|
|
263
272
|
|
264
273
|
attr_reader :pid_file_path
|
265
274
|
|
275
|
+
attr_reader :task_id
|
276
|
+
|
266
277
|
end
|
267
278
|
|
268
279
|
end # module StreamingLoad
|
@@ -8,6 +8,7 @@ module Bricolage
|
|
8
8
|
|
9
9
|
def initialize(s3ds)
|
10
10
|
@s3ds = s3ds
|
11
|
+
@logger = @s3ds.logger
|
11
12
|
end
|
12
13
|
|
13
14
|
def log(task)
|
@@ -24,7 +25,7 @@ module Bricolage
|
|
24
25
|
|
25
26
|
def content(task)
|
26
27
|
buf = StringIO.new
|
27
|
-
|
28
|
+
task.chunks.each do |chunk|
|
28
29
|
buf.puts %Q("#{task.id}","#{chunk.id}","#{chunk.url}")
|
29
30
|
end
|
30
31
|
buf.string
|