cantemo-portal-agent 1.2.1 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cantemo/portal/agent/version.rb +1 -1
- data/lib/cantemo/portal/api/client.rb +1 -1
- data/lib/envoi/aspera/watch_service/client.rb +1 -1
- data/lib/envoi/mam/cantemo/agent.rb +1 -3
- data/lib/envoi/mam/cantemo/agent/watch_folder_manager.rb +4 -2
- data/lib/envoi/watch_folder_utility/watch_folder.rb +4 -0
- data/lib/envoi/watch_folder_utility/watch_folder/handler/listen.rb +8 -4
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ee35911bd6bae5512fa8dbd656bcf191fe548f9
|
4
|
+
data.tar.gz: dcf5c261b9b184b9734c3b0cc9d4e9c996464e98
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fcf6fe6526c7db201d74242d7d13d897944ab2ff0b0d09bb2adec07e98c3053dabd1abd083b5b4c0f5afc50153ed3dfcdbbf7a2c6c1517d6b43e5c16d293f03
|
7
|
+
data.tar.gz: 28e97981b20cc01ff0c379483d5d52717f9ef07ed7e013c62bcc32cd5b133f592b19b1bd3b5afbc5a8e84e0f460f4557547d2411fe7206f4cd1d725a66567c89
|
@@ -13,7 +13,7 @@ module Envoi
|
|
13
13
|
|
14
14
|
attr_accessor :aswatchadmin_executable_path, :default_username
|
15
15
|
|
16
|
-
DEFAULT_ASWATCHADMIN_EXECUTABLE_PATH = '/Library/Aspera/bin/
|
16
|
+
DEFAULT_ASWATCHADMIN_EXECUTABLE_PATH = '/Library/Aspera/bin/d'
|
17
17
|
|
18
18
|
DAEMON_NAME_FIELD_NAME = 'name'
|
19
19
|
DAEMON_CONFIGURATION_FIELD_NAME = 'configuration'
|
@@ -44,7 +44,7 @@ module Envoi
|
|
44
44
|
api_config = agent_config
|
45
45
|
@api_client = args[:api_client] || begin
|
46
46
|
client_args = Hash[api_config.map { |k,v| [ k.respond_to?(:to_sym) ? k.to_sym.downcase : k, v ]}]
|
47
|
-
_client = Cantemo::Portal::API::Client.new(client_args)
|
47
|
+
_client = ::Cantemo::Portal::API::Client.new(client_args)
|
48
48
|
|
49
49
|
begin
|
50
50
|
_client.version
|
@@ -293,8 +293,6 @@ module Envoi
|
|
293
293
|
if item_id
|
294
294
|
item_shape_import_response = api_client.item_shape_import(item_id: item_id,
|
295
295
|
tag: shape_tag, fileId: file_id)
|
296
|
-
|
297
|
-
|
298
296
|
else
|
299
297
|
import_args = {
|
300
298
|
storage_id: storage_id,
|
@@ -224,7 +224,8 @@ module Envoi::Mam::Cantemo
|
|
224
224
|
logger.debug { "Maximum number of active processors reached for watch folder. #{wf.name || wf.paths}" }
|
225
225
|
next
|
226
226
|
end
|
227
|
-
t = Thread.new(
|
227
|
+
t = Thread.new(file) do |file|
|
228
|
+
wf = file.watch_folder
|
228
229
|
begin
|
229
230
|
process_file(file)
|
230
231
|
rescue => e
|
@@ -268,7 +269,8 @@ module Envoi::Mam::Cantemo
|
|
268
269
|
# AWF.run(watch_folders) { |wf| process_watch_folder(wf) }
|
269
270
|
|
270
271
|
logger.info { 'Running...' }
|
271
|
-
watch_folders.map { |wf| wf.run
|
272
|
+
watch_folders.map { |wf| wf.respond_to?(:run) ? wf.run : logger.debug { "Skip run for #{wf}" } }
|
273
|
+
logger.debug { 'Initial Run Complete.' }
|
272
274
|
loop do
|
273
275
|
begin
|
274
276
|
poll
|
@@ -92,7 +92,6 @@ module Envoi
|
|
92
92
|
process_definition(@definition)
|
93
93
|
initialize_listener
|
94
94
|
logger.debug ( "Watch Folder Handler '#{self.class.name}' Initialized. ")
|
95
|
-
perform_initial_inventory
|
96
95
|
end
|
97
96
|
|
98
97
|
def initialize_logger(args = { })
|
@@ -148,17 +147,17 @@ module Envoi
|
|
148
147
|
def initialize_listener(args = { })
|
149
148
|
@listener = ::Listen.to(*paths, {}) do |m, a, r|
|
150
149
|
if !r.empty?
|
151
|
-
|
150
|
+
logger.info { "#{r.length} file(s) removed." }
|
152
151
|
lock.synchronize { r.each { |f| process_deleted_path(f) } }
|
153
152
|
end
|
154
153
|
|
155
154
|
if !m.empty?
|
156
|
-
|
155
|
+
logger.info { "#{m.length} file(s) modified." }
|
157
156
|
lock.synchronize { process_add_or_modified_path(m, :modified) }
|
158
157
|
end
|
159
158
|
|
160
159
|
if !a.empty?
|
161
|
-
|
160
|
+
logger.info { "#{a.length} file(s) added." }
|
162
161
|
lock.synchronize { process_add_or_modified_path(a, :added) }
|
163
162
|
end
|
164
163
|
|
@@ -214,8 +213,13 @@ module Envoi
|
|
214
213
|
@known_path_map.select { |p,f| f.stable? }.values
|
215
214
|
end
|
216
215
|
|
216
|
+
def run_once(options = { })
|
217
|
+
perform_initial_inventory
|
218
|
+
end
|
219
|
+
|
217
220
|
def run(options = { })
|
218
221
|
logger.info { "Starting handler for #{paths}" }
|
222
|
+
perform_initial_inventory
|
219
223
|
listener.start
|
220
224
|
end
|
221
225
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cantemo-portal-agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Whitson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asperalm
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: faraday
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0.15'
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0.15'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: listen
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|