canvas_sync 0.17.23.beta4 → 0.17.23.beta8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/initializers/apartment.rb +9 -0
- data/lib/canvas_sync/generators/templates/migrations/create_grading_period_groups.rb +0 -4
- data/lib/canvas_sync/generators/templates/models/grading_period_group.rb +0 -2
- data/lib/canvas_sync/generators/templates/models/term.rb +1 -0
- data/lib/canvas_sync/job_batches/batch.rb +82 -51
- data/lib/canvas_sync/job_batches/pool.rb +42 -52
- data/lib/canvas_sync/jobs/sync_terms_job.rb +1 -1
- data/lib/canvas_sync/processors/model_mappings.yml +0 -6
- data/lib/canvas_sync/version.rb +1 -1
- data/spec/dummy/app/models/grading_period_group.rb +0 -2
- data/spec/dummy/app/models/term.rb +1 -0
- data/spec/dummy/db/migrate/{20210907233331_create_grading_period_groups.rb → 20211001184920_create_grading_period_groups.rb} +0 -4
- data/spec/dummy/db/schema.rb +1 -5
- data/spec/dummy/log/development.log +902 -0
- data/spec/dummy/log/test.log +51547 -0
- data/spec/job_batching/batch_spec.rb +39 -0
- metadata +4 -4
@@ -453,4 +453,43 @@ RSpec.describe CanvasSync::JobBatches::Batch do
|
|
453
453
|
end
|
454
454
|
end
|
455
455
|
end
|
456
|
+
|
457
|
+
describe '.redis' do
|
458
|
+
it 'returns the same connection if called when nested' do
|
459
|
+
CanvasSync::JobBatches::Batch.redis do |r1|
|
460
|
+
CanvasSync::JobBatches::Batch.redis do |r2|
|
461
|
+
expect(r1).to be r2
|
462
|
+
end
|
463
|
+
end
|
464
|
+
end
|
465
|
+
|
466
|
+
it 'returns a RedisProxy object if no block is given' do
|
467
|
+
expect(CanvasSync::JobBatches::Batch.redis).to be_a(CanvasSync::JobBatches::Batch::RedisProxy)
|
468
|
+
end
|
469
|
+
|
470
|
+
describe 'RedisProxy' do
|
471
|
+
let!(:proxy) { CanvasSync::JobBatches::Batch.redis }
|
472
|
+
|
473
|
+
it 'calls Batch.redis with a block' do
|
474
|
+
expect(CanvasSync::JobBatches::Batch).to receive(:redis) do |&block|
|
475
|
+
expect(block).to be_a Proc
|
476
|
+
end
|
477
|
+
proxy.sadd('KEY', 5)
|
478
|
+
end
|
479
|
+
|
480
|
+
describe '#multi' do
|
481
|
+
it 'works with 1 arity' do
|
482
|
+
proxy.multi do |r|
|
483
|
+
r.sadd('KEY', 5)
|
484
|
+
end
|
485
|
+
end
|
486
|
+
|
487
|
+
it 'works with 0 arity' do
|
488
|
+
proxy.multi do
|
489
|
+
proxy.sadd('KEY', 5)
|
490
|
+
end
|
491
|
+
end
|
492
|
+
end
|
493
|
+
end
|
494
|
+
end
|
456
495
|
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.17.23.
|
4
|
+
version: 0.17.23.beta8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nate Collings
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -610,7 +610,7 @@ files:
|
|
610
610
|
- spec/dummy/db/migrate/20201016181346_create_pseudonyms.rb
|
611
611
|
- spec/dummy/db/migrate/20210907233329_create_user_observers.rb
|
612
612
|
- spec/dummy/db/migrate/20210907233330_create_grading_periods.rb
|
613
|
-
- spec/dummy/db/migrate/
|
613
|
+
- spec/dummy/db/migrate/20211001184920_create_grading_period_groups.rb
|
614
614
|
- spec/dummy/db/schema.rb
|
615
615
|
- spec/dummy/log/development.log
|
616
616
|
- spec/dummy/log/test.log
|
@@ -813,7 +813,7 @@ test_files:
|
|
813
813
|
- spec/dummy/db/migrate/20201016181346_create_pseudonyms.rb
|
814
814
|
- spec/dummy/db/migrate/20210907233329_create_user_observers.rb
|
815
815
|
- spec/dummy/db/migrate/20210907233330_create_grading_periods.rb
|
816
|
-
- spec/dummy/db/migrate/
|
816
|
+
- spec/dummy/db/migrate/20211001184920_create_grading_period_groups.rb
|
817
817
|
- spec/dummy/db/schema.rb
|
818
818
|
- spec/dummy/log/development.log
|
819
819
|
- spec/dummy/log/test.log
|