canvas_sync 0.17.31 → 0.17.32
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac101dc1c7a2d590408677aac25218ac20b762d993413c57ae9f8164b50fb3ad
|
4
|
+
data.tar.gz: c1d4785903974a78e8efc0612e5b36b0c342c6fb8bcfb615616c1e6002cb2186
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61f0685f874a9476d8130923b191e7ee1389fcf1cd7374f7b482c11c1e073b30a69796f43b02894cfd37800f7d2240e52d5e48291e8b0f8f8c3698d4f3e84938
|
7
|
+
data.tar.gz: d2a76163cf0a26ba32a96811c1d9e5ac63b6cc7bb23255a27416562e71bd25ee7ae1d57c0d8b21c8043701c9f76eed219469cf48c82883d68d403f938d4f6b0a
|
@@ -28,7 +28,7 @@ module CanvasSync
|
|
28
28
|
|
29
29
|
delegate :redis, to: :class
|
30
30
|
|
31
|
-
BID_EXPIRE_TTL =
|
31
|
+
BID_EXPIRE_TTL = 90.days.to_i
|
32
32
|
SCHEDULE_CALLBACK = RedisScript.new(Pathname.new(__FILE__) + "../schedule_callback.lua")
|
33
33
|
BID_HIERARCHY = RedisScript.new(Pathname.new(__FILE__) + "../hier_batch_ids.lua")
|
34
34
|
|
@@ -101,6 +101,8 @@ module CanvasSync
|
|
101
101
|
r.hincrby("BID-#{parent_bid}", "children", 1)
|
102
102
|
r.expire("BID-#{parent_bid}", BID_EXPIRE_TTL)
|
103
103
|
r.zadd("BID-#{parent_bid}-bids", created_at, bid)
|
104
|
+
else
|
105
|
+
r.zadd("BID-ROOT-bids", created_at, bid)
|
104
106
|
end
|
105
107
|
end
|
106
108
|
|
@@ -369,6 +371,7 @@ module CanvasSync
|
|
369
371
|
logger.debug {"Cleaning redis of batch #{bid}"}
|
370
372
|
redis do |r|
|
371
373
|
r.zrem("batches", bid)
|
374
|
+
r.zrem("BID-ROOT-bids", bid)
|
372
375
|
r.unlink(
|
373
376
|
"BID-#{bid}",
|
374
377
|
"BID-#{bid}-callbacks-complete",
|
@@ -10,6 +10,8 @@ require_relative "web/helpers"
|
|
10
10
|
module CanvasSync::JobBatches::Sidekiq
|
11
11
|
module Web
|
12
12
|
DEV_MODE = (defined?(Rails) && !Rails.env.production?) || !!ENV["SIDEKIQ_WEB_TESTING"]
|
13
|
+
Sidekiq::WebHelpers::SAFE_QPARAMS << 'all_batches'
|
14
|
+
Sidekiq::WebHelpers::SAFE_QPARAMS << 'count'
|
13
15
|
|
14
16
|
def self.registered(app) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
15
17
|
app.helpers do
|
@@ -24,7 +26,9 @@ module CanvasSync::JobBatches::Sidekiq
|
|
24
26
|
|
25
27
|
app.get "/batches" do
|
26
28
|
@count = (params['count'] || 25).to_i
|
27
|
-
|
29
|
+
|
30
|
+
source_key = params['all_batches'] ? "batches" : "BID-ROOT-bids"
|
31
|
+
@current_page, @total_size, @batches = page(source_key, params['page'], @count)
|
28
32
|
@batches = @batches.map {|b, score| CanvasSync::JobBatches::Batch.new(b) }
|
29
33
|
|
30
34
|
erb(get_template(:batches))
|
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.17.
|
4
|
+
version: 0.17.32
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nate Collings
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|