inst_data_shipper 0.2.4 → 0.2.6

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
  SHA256:
3
- metadata.gz: d2f09c00768c10bfc79fb35c689131740739a8889c81ee02186f4bd9e70b446b
4
- data.tar.gz: 9550a780011a5fa988fff785429a637175a16634911186e7bb7625e80ac09141
3
+ metadata.gz: 9374e4353fc38c211cd8d7565b271f9a1543c8e6165d1716cffa93f0704d974b
4
+ data.tar.gz: de10a934800be0a8560fd241341da120e7b453cff3d7806664e7e8260c0ef33d
5
5
  SHA512:
6
- metadata.gz: f5f4fd607175698b654476ed4ef50d600be06b380071469e9fda824433d3d7014bacbecc53cb25238a5ade8d1ce5b302192bc7aa8f48c922e0ae029b56d4fcac
7
- data.tar.gz: 6d069aa519374716b5690ba2428f6f4ec2000ae36b716921e36aab9160d126dc53a4db1f8d7614d97d82849d62138d7464ffd4f719c39ee226f7becad7b50514
6
+ metadata.gz: 4b0599be4475101ea1ad5e5c5db90134628cdbf1e60e3b440a1f9f4fa90023da5da31c39d868f3fb431a9037f4a25159f0e283e253888da9432153db1b838edf
7
+ data.tar.gz: a8be277a20e03c4363f3a527dd0aa382252e330d73bdcb02f58a9c032f69b5cf19279c316d5fd5712e0570f71da9306b38d103af431a04b6aa38d7915155819d
@@ -28,7 +28,7 @@ module InstDataShipper
28
28
  end
29
29
 
30
30
  def import_canvas_report_by_terms(*args, **kwargs)
31
- _in_canvas_report_pool(:_import_canvas_report_by_terms, *args, **kwargs)
31
+ delayed(:_import_canvas_report_by_terms, *args, **kwargs)
32
32
  end
33
33
 
34
34
  def import_existing_report(report, **kwargs)
@@ -87,7 +87,7 @@ module InstDataShipper
87
87
  },
88
88
  on_failure: {
89
89
  job: Jobs::AsyncCaller,
90
- args: [origin_class, :_handle_failed_canvas_report, report_name, kwargs],
90
+ args: [origin_class, :_handle_failed_canvas_report, report_name, { **kwargs, params: }],
91
91
  kwargs: { retry_count: retry_count },
92
92
  },
93
93
  status_key: :status,
@@ -96,8 +96,7 @@ module InstDataShipper
96
96
  end
97
97
 
98
98
  def _in_canvas_report_pool(mthd, *args, **kwargs)
99
- pool = CanvasSync::JobBatches::Pool.from_pid(batch_context[:report_processor_pool])
100
- Jobs::AsyncCaller.call_from_pool(pool, self.class, mthd, *args, **kwargs)
99
+ call_in_pool(batch_context[:report_processor_pool], mthd, *args, **kwargs)
101
100
  end
102
101
 
103
102
  def _process_canvas_report(report:, schema_name: nil)
@@ -171,6 +170,8 @@ module InstDataShipper
171
170
  end
172
171
 
173
172
  def _handle_failed_canvas_report(report_name, kwargs, retry_count:, report:)
173
+ return if report.dig("parameters", "extra_text")&.include?("Failed, the report failed to generate a file")
174
+
174
175
  if retry_count.positive?
175
176
  tbid = batch_context[:report_bid] || batch_context[:root_bid]
176
177
  Sidekiq::Batch.new(tbid).jobs do
@@ -308,6 +308,11 @@ module InstDataShipper
308
308
  Jobs::AsyncCaller.perform_later(self.class.to_s, mthd.to_s, *args, **kwargs)
309
309
  end
310
310
 
311
+ def call_in_pool(pool, mthd, *args, **kwargs)
312
+ pool = CanvasSync::JobBatches::Pool.from_pid(pool) if pool.is_a?(String)
313
+ Jobs::AsyncCaller.call_from_pool(pool, self.class, mthd, *args, **kwargs)
314
+ end
315
+
311
316
  delegate :working_dir, to: :executor
312
317
 
313
318
  def batch
@@ -1,3 +1,3 @@
1
1
  module InstDataShipper
2
- VERSION = "0.2.4".freeze
2
+ VERSION = "0.2.6".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inst_data_shipper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure CustomDev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-02 00:00:00.000000000 Z
11
+ date: 2024-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails