mass-client 1.0.22 → 1.0.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/first-line/profile_rpa.rb +9 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a5ae6cc2ac6143f4c2a98af32576c2cf85c2fe27faa8d7e1746df88d4192fe0
|
4
|
+
data.tar.gz: 9e3a2043d09803dc5a668fc5a03409819f296be6bd3ce5d35e6338dabfb991eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96e85dce902b72f67f6ff88c546591a639f126fb814b561fb1c1845036dcd159e04cafd7c7aa6921878fbbb5e991ca1eaf7ed320d1588c09217770e91a3c2ae8
|
7
|
+
data.tar.gz: 02edbb6c8c90ba3fbbdc4f2202cd67ce5bc079f70cc7bc3a54c17e318fdb8c4715cbec556a5593ac74c0db394a17d78f5f3ccac204a91ca463367786883869d3
|
@@ -218,14 +218,14 @@ module Mass
|
|
218
218
|
#
|
219
219
|
# @return [String] The URL of the file in Dropbox, with the `&dl=1` parameter
|
220
220
|
# replaced by `&dl=0`.
|
221
|
-
# @
|
221
|
+
# @return nil If the file is not available within the specified
|
222
222
|
# maximum wait time, raises an error with a timeout message.
|
223
223
|
#
|
224
224
|
# @example
|
225
225
|
# wait_for_dropbox_url('/path/to/file', max_wait: 60, interval: 3)
|
226
226
|
# # => "https://www.dropbox.com/s/yourfile?dl=0"
|
227
227
|
#
|
228
|
-
def wait_for_dropbox_url(path, max_wait:
|
228
|
+
def wait_for_dropbox_url(path, max_wait: 5, interval: 2)
|
229
229
|
start_time = Time.now
|
230
230
|
|
231
231
|
loop do
|
@@ -235,7 +235,8 @@ module Mass
|
|
235
235
|
rescue => e
|
236
236
|
# Check if the timeout has been exceeded
|
237
237
|
if Time.now - start_time > max_wait
|
238
|
-
raise "Timeout exceeded while waiting for Dropbox file (#{path}): #{e.message}"
|
238
|
+
#raise "Timeout exceeded while waiting for Dropbox file (#{path}): #{e.message}"
|
239
|
+
return nil
|
239
240
|
end
|
240
241
|
|
241
242
|
# Wait for a short interval before retrying
|
@@ -326,7 +327,11 @@ module Mass
|
|
326
327
|
BlackStack::DropBox.dropbox_create_folder(folder)
|
327
328
|
|
328
329
|
# Upload the file to Dropbox
|
329
|
-
BlackStack::DropBox.dropbox_upload_file(tmp_path, path)
|
330
|
+
s = BlackStack::DropBox.dropbox_upload_file(tmp_path, path)
|
331
|
+
json = JSON.parse(s)
|
332
|
+
if json['is_downloadable'].nil? || !json['is_downloadable']
|
333
|
+
raise "Dropbox file upload failed. Dropbox response: #{s}"
|
334
|
+
end
|
330
335
|
# Delete the local file
|
331
336
|
File.delete(tmp_path)
|
332
337
|
|