canvas_sync 0.17.0.beta10 → 0.17.0.beta11

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
  SHA256:
3
- metadata.gz: 7e44255a358ea745c6d434b9977d97c37c7dd649ae3fdc9679b7e37546a4e014
4
- data.tar.gz: cab18a5115b02798a7f25fcd062db9a6c6ef8f5394c018fb332be766444ca460
3
+ metadata.gz: a6d329899fbeae89b111e225d044250383eb6f4a0547c0883e0ff555a331f5f3
4
+ data.tar.gz: ab87348b3d757fbb6acacdf7b7118f7a8da4f290643b34cc7bf0dcdc01f9d109
5
5
  SHA512:
6
- metadata.gz: 5b06550842f727c1615e7b84daa7f7f66c05ff2a440f4e319f3ac7bf435e9d89da826d805eedfa5fbe5b7c8f16a9aefa276db182139ceffa6a8f70faca1a7156
7
- data.tar.gz: 4b53ae2ef1df19049f981d0e585e800d5291dd203acafda0d9d5ed3015341ce0af35e9e41c437271eec29efb9fc059ae53db2e1f8a176c13382b70eeea663deb
6
+ metadata.gz: 9090f7b6058736f5b012d1c1bda245a100a9fbe3eb89eb27f27ba29fefcb3f4d36e464315186acf13dbc298b17d6b3d634e7a2ba5fedd086c31fefa94ef70224
7
+ data.tar.gz: ac4f18e914e1310cc74d209620b97af398c86e22f6c48220e1d3ae15dbb4ab483480ae4ee9e34ad8eb964cdd2bdfb1355dc2cdd142eef59e3d5297f34bae78f8
@@ -126,8 +126,6 @@ module CanvasSync
126
126
 
127
127
  job_queue = @ready_to_queue = []
128
128
 
129
- puts "Beginning Batch #{bid}"
130
-
131
129
  begin
132
130
  parent = Thread.current[:batch]
133
131
  Thread.current[:batch] = self
@@ -373,19 +371,19 @@ module CanvasSync
373
371
 
374
372
  def cleanup_redis(bid)
375
373
  logger.debug {"Cleaning redis of batch #{bid}"}
376
- # redis do |r|
377
- # r.del(
378
- # "BID-#{bid}",
379
- # "BID-#{bid}-callbacks-complete",
380
- # "BID-#{bid}-callbacks-success",
381
- # "BID-#{bid}-failed",
382
-
383
- # "BID-#{bid}-batches-success",
384
- # "BID-#{bid}-batches-complete",
385
- # "BID-#{bid}-batches-failed",
386
- # "BID-#{bid}-jids",
387
- # )
388
- # end
374
+ redis do |r|
375
+ r.del(
376
+ "BID-#{bid}",
377
+ "BID-#{bid}-callbacks-complete",
378
+ "BID-#{bid}-callbacks-success",
379
+ "BID-#{bid}-failed",
380
+
381
+ "BID-#{bid}-batches-success",
382
+ "BID-#{bid}-batches-complete",
383
+ "BID-#{bid}-batches-failed",
384
+ "BID-#{bid}-jids",
385
+ )
386
+ end
389
387
  end
390
388
 
391
389
  def redis(*args, &blk)
@@ -35,7 +35,7 @@ module CanvasSync
35
35
  protected
36
36
 
37
37
  def merge_report_params(options={}, params={}, term_scope: true)
38
- term_scope = batch_context[:canvas_term_id] if term_scope == true
38
+ term_scope = options[:canvas_term_id] || batch_context[:canvas_term_id] if term_scope == true
39
39
  if term_scope.present?
40
40
  params[:enrollment_term_id] = term_scope
41
41
  end
@@ -43,6 +43,7 @@ module CanvasSync
43
43
  params[:updated_after] = updated_after
44
44
  end
45
45
  params.merge!(options[:report_params]) if options[:report_params].present?
46
+ params.merge!(options[:report_parameters]) if options[:report_parameters].present?
46
47
  { parameters: params }
47
48
  end
48
49
 
@@ -1,23 +1,8 @@
1
1
  module CanvasSync
2
2
  module Jobs
3
3
  # ActiveJob class that starts a Canvas provisioning report
4
- class SyncProvisioningReportJob < CanvasSync::Job
4
+ class SyncProvisioningReportJob < ReportStarter
5
5
  def perform(options)
6
- start_report(report_params(options), options)
7
- end
8
-
9
- protected
10
-
11
- def start_report(report_params, options)
12
- CanvasSync::Jobs::ReportStarter.perform_later(
13
- "proservices_provisioning_csv",
14
- report_params,
15
- CanvasSync::Processors::ProvisioningReportProcessor.to_s,
16
- options,
17
- )
18
- end
19
-
20
- def report_params(options, canvas_term_id = options[:canvas_term_id] || batch_context[:canvas_term_id])
21
6
  params = {
22
7
  include_deleted: true,
23
8
  }
@@ -28,11 +13,12 @@ module CanvasSync
28
13
  params[model] = true
29
14
  end
30
15
 
31
- params[:enrollment_term_id] = canvas_term_id if canvas_term_id
32
-
33
- params.merge!(options[:report_parameters]) if options[:report_parameters].present?
34
-
35
- { parameters: params }
16
+ super(
17
+ "proservices_provisioning_csv",
18
+ merge_report_params(options, params, {}),
19
+ CanvasSync::Processors::ProvisioningReportProcessor.to_s,
20
+ options,
21
+ )
36
22
  end
37
23
  end
38
24
  end
@@ -1,3 +1,3 @@
1
1
  module CanvasSync
2
- VERSION = "0.17.0.beta10".freeze
2
+ VERSION = "0.17.0.beta11".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canvas_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0.beta10
4
+ version: 0.17.0.beta11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nate Collings