canvas_sync 0.18.6 → 0.18.8

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: ef5adc65f2560567bff6cb71e817e646fe6f3d727cc0def5ec3b8cdee798131e
4
- data.tar.gz: 8380125f3523e3f08861c1af47e4b81178955ed215a2c0b0f0f63a06921d6f45
3
+ metadata.gz: 33a5018a59c29aa95670c467beba015277c9991bc7767987ea6f29f1444f18fa
4
+ data.tar.gz: 585cb02b25db814d71f4b6626142e3b85965f6bdcf7547cf879f0094cfc3dad2
5
5
  SHA512:
6
- metadata.gz: fe874e5e55c77e566f9cce71981e55c2482cd72740ae07c4b9dddeae5bd971df5b694f08bc9479d7096256da8eca9a5f169d4c964b4b733e6e872f069de563d8
7
- data.tar.gz: ab9d9a36d9eae58eff042131b5f8166908e7690482a04de2e2f14f7086a09227c919c4e02f9b012ba3baccdd929c93c06c7029fc9494907c6ab55ea85899a88e
6
+ metadata.gz: '0618fa0863292e0b97a68d237037583d61da3e40c1f9ae4596b3f1198fc9d664ff49f9dc5d8eabc2c397dc84d7753bbed30a7cabda5b4588e1fbb89bbdb1d854'
7
+ data.tar.gz: 0d9b2156a11c1eb1eeadb894f81accf0f75bf92166ce1fec0c8eacdf2a657fb5d64dc8a20422fd649a99d81a7fc933c632376ac73dbec48b73a3a8a53c56c2c6
@@ -90,10 +90,12 @@ module CanvasSync::Concerns
90
90
  private
91
91
 
92
92
  def api_sync_race_create!(inst, save: true)
93
- inst = find_or_initialize_by(canvas_id: inst) unless inst.is_a?(self)
94
- yield inst
95
- inst.save! if save && inst.changed?
96
- inst
93
+ transaction(requires_new: true) do
94
+ inst = find_or_initialize_by(canvas_id: inst) unless inst.is_a?(self)
95
+ yield inst
96
+ inst.save! if save && inst.changed?
97
+ inst
98
+ end
97
99
  rescue ActiveRecord::RecordNotUnique
98
100
  inst = find_by(canvas_id: inst.canvas_id)
99
101
  yield inst
@@ -45,7 +45,7 @@ module CanvasSync
45
45
  redis_attr :created_at
46
46
  redis_attr :callback_queue, read_only: false
47
47
  redis_attr :callback_params, :json
48
- redis_attr :allow_context_changes
48
+ redis_attr :allow_context_changes, :bool
49
49
 
50
50
  def context
51
51
  return @context if defined?(@context)
@@ -20,7 +20,7 @@ module CanvasSync
20
20
  Batch.redis do |r|
21
21
  r.multi do |r|
22
22
  r.hset("MNGBID-#{man_batch_id}", "root_bid", root_batch.bid)
23
- r.hset("MNGBID-#{man_batch_id}", "ordered", ordered)
23
+ r.hset("MNGBID-#{man_batch_id}", "ordered", ordered ? 1 : 0)
24
24
  r.hset("MNGBID-#{man_batch_id}", "concurrency", concurrency)
25
25
  r.expire("MNGBID-#{man_batch_id}", Batch::BID_EXPIRE_TTL)
26
26
 
@@ -93,6 +93,8 @@ module CanvasSync
93
93
  end
94
94
  end
95
95
 
96
+ ordered = CanvasSync::MiscHelper.to_boolean(ordered)
97
+
96
98
  next_job_json = Batch.redis do |r|
97
99
  if ordered
98
100
  r.lpop("MNGBID-#{man_batch_id}-jobs")
@@ -41,13 +41,13 @@ module CanvasSync
41
41
  if @initialized || @existing
42
42
  redis do |r|
43
43
  r.multi do |r|
44
- r.hset(redis_key, attribute, value)
44
+ r.hset(redis_key, attribute, value.to_s)
45
45
  r.expire(redis_key, Batch::BID_EXPIRE_TTL)
46
46
  end
47
47
  end
48
48
  else
49
49
  @pending_attrs ||= {}
50
- @pending_attrs[attribute] = value
50
+ @pending_attrs[attribute] = value.to_s
51
51
  end
52
52
  end
53
53
 
@@ -1,3 +1,3 @@
1
1
  module CanvasSync
2
- VERSION = "0.18.6".freeze
2
+ VERSION = "0.18.8".freeze
3
3
  end
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.18.6
4
+ version: 0.18.8
5
5
  platform: ruby
6
6
  authors:
7
- - Nate Collings
7
+ - Instructure CustomDev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-14 00:00:00.000000000 Z
11
+ date: 2023-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -390,7 +390,7 @@ dependencies:
390
390
  version: '0'
391
391
  description:
392
392
  email:
393
- - ncollings@instructure.com
393
+ - pseng@instructure.com
394
394
  executables: []
395
395
  extensions: []
396
396
  extra_rdoc_files: []