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: '09cebb9b63254bcdf9e96ae0133d882fcf800ad405f6d53080793e8f3f0c052f'
4
- data.tar.gz: 40d27ea858ac931d006ccbab54f7ee1b725166ad3fec4ecb369f6e3f0fa611f1
3
+ metadata.gz: ac101dc1c7a2d590408677aac25218ac20b762d993413c57ae9f8164b50fb3ad
4
+ data.tar.gz: c1d4785903974a78e8efc0612e5b36b0c342c6fb8bcfb615616c1e6002cb2186
5
5
  SHA512:
6
- metadata.gz: de38e11de998bef7cca15c875d63b29984d2cdf4dd90436854484e5686c5aca4eb249fd864e24b66d532afcba63b3f7ddb62c5e5abf55d1e2c621fa6cb566af7
7
- data.tar.gz: 8493bc7a6f100da697840f65aeaceacbacc95c224aa53c66129e19d5a88d61b1f59202252ac80b2e8d42fc4661f974b30bd1825b448e58b477ce9e33f71a9f2c
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 = 2_592_000
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
- @current_page, @total_size, @batches = page('batches', params['page'], @count)
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))
@@ -1,3 +1,3 @@
1
1
  module CanvasSync
2
- VERSION = "0.17.31".freeze
2
+ VERSION = "0.17.32".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.17.31
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-04-14 00:00:00.000000000 Z
11
+ date: 2022-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails