canvas_sync 0.3.2 → 0.3.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cb4e4d83e146469a152b7582f9dff23adbf57e5
|
4
|
+
data.tar.gz: 7ac7ec7146259a6099093c63134a070af1656a07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b98e4574ce7bce06cfba710c003fe8e8b4bf48b3f84326307d099bc9ab80136384c367ef4913e85a80331e4f0a855e41c40ea89e5cb4f30dec7af9e81c7585e
|
7
|
+
data.tar.gz: d572b58ae50eab9287e04972f79a72f0619cb25623a8615d4c2e55f93f58d54c9232e5371ffce4d844405380fb8c7e4e4d5706909f88f730d75878ddab10280a
|
@@ -11,29 +11,30 @@ module CanvasSync
|
|
11
11
|
# @param options [Hash] hash of options that will be passed to the job processor
|
12
12
|
# @return [nil]
|
13
13
|
def perform(job_chain, report_name, report_id, processor, options)
|
14
|
-
|
14
|
+
account_id = options[:account_id] || job_chain[:global_options][:account_id] || 'self'
|
15
|
+
report_status = CanvasSync.get_canvas_sync_client(job_chain[:global_options]).report_status(account_id, report_name, report_id)
|
15
16
|
|
16
17
|
case report_status['status'].downcase
|
17
|
-
|
18
|
-
|
18
|
+
when 'complete'
|
19
|
+
CanvasSync::Jobs::ReportProcessorJob.perform_later(
|
19
20
|
job_chain,
|
20
21
|
report_name,
|
21
22
|
report_status['attachment']['url'],
|
22
23
|
processor,
|
23
24
|
options
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
25
|
+
)
|
26
|
+
when 'error', 'deleted'
|
27
|
+
message = "Report failed to process; status was #{report_status} for report_name: #{report_name}, report_id: #{report_id}"
|
28
|
+
Rails.logger.error(message)
|
29
|
+
raise message
|
30
|
+
else
|
31
|
+
CanvasSync::Jobs::ReportChecker.set(wait: report_checker_wait_time)
|
31
32
|
.perform_later(
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
job_chain,
|
34
|
+
report_name,
|
35
|
+
report_id,
|
36
|
+
processor,
|
37
|
+
options
|
37
38
|
)
|
38
39
|
end
|
39
40
|
end
|
@@ -15,10 +15,7 @@ module CanvasSync
|
|
15
15
|
def perform(job_chain, report_name, report_url, processor, options)
|
16
16
|
@job_log.update_attributes(job_class: processor)
|
17
17
|
download(report_name, report_url) do |file_path|
|
18
|
-
options =
|
19
|
-
legacy_support: job_chain[:global_options][:legacy_support],
|
20
|
-
account_id: job_chain[:global_options][:account_id]
|
21
|
-
})
|
18
|
+
options = job_chain[:global_options].merge(options)
|
22
19
|
processor.constantize.process(file_path, options)
|
23
20
|
end
|
24
21
|
|
@@ -9,14 +9,15 @@ module CanvasSync
|
|
9
9
|
# @param options [Hash] hash of options that will be passed to the job processor
|
10
10
|
# @return [nil]
|
11
11
|
def perform(job_chain, report_name, report_params, processor, options)
|
12
|
-
|
12
|
+
account_id = options[:account_id] || job_chain[:global_options][:account_id] || 'self'
|
13
|
+
report = CanvasSync.get_canvas_sync_client(job_chain[:global_options]).start_report(account_id, report_name, report_params)
|
13
14
|
|
14
15
|
CanvasSync::Jobs::ReportChecker.set(wait: report_checker_wait_time).perform_later(
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
job_chain,
|
17
|
+
report_name,
|
18
|
+
report['id'],
|
19
|
+
processor,
|
20
|
+
options
|
20
21
|
)
|
21
22
|
end
|
22
23
|
end
|
data/lib/canvas_sync/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: canvas_sync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nate Collings
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|