culturecode_stagehand 0.13.0 → 0.13.1

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
  SHA1:
3
- metadata.gz: 857f95b5a3b62d7c9721088e576c7df2acae86e3
4
- data.tar.gz: a11fd6f5835f5d771df5dd1dd2a130da49e3706a
3
+ metadata.gz: eb2b08c122596046788d7fa78b94a8087a5fbe53
4
+ data.tar.gz: 6e7caaffa2016dbf8b3ccf51219db0ee88be3639
5
5
  SHA512:
6
- metadata.gz: 5acfa20882adbeeece5efe8526c39db3e92fc8bde5e0a5574ea79572453e10c046b464a7aa462e1612cc920231c9745131a5947d26cd32836960d2a0e95ffff7
7
- data.tar.gz: 0c902d34b70b159bc6b3252d64c1fdd2189072261aca509fbba149b9cb7a56ffdfc2fecbc965059035522959f6c140d2cc5606fdb2e6f25e82ece3fcdeb98163
6
+ metadata.gz: 8bd0c3bc83ba04214a318814d7ab4a74d2c2bcf939c7234fc154e049617402a6c732479a09e374fadc7f153d8388ad5acc1bb8ae983b3032a9f4c0f6cfb2c11e
7
+ data.tar.gz: 6b9b05ce1222fc70191a38a7ebb4c27b151d0f8f999485045d85d15c3975e96ba55a958e1930cc65c910ed11e615818b77ff6b03d1e44fbe4e8560773e407cf1
@@ -83,12 +83,10 @@ module Stagehand
83
83
  # Lazily iterate through millions of commit entries
84
84
  # Returns commit entries in ID descending order
85
85
  def iterate_autosyncable_entries(&block)
86
- max = CommitEntry.maximum(:id).to_i
87
- min = CommitEntry.minimum(:id).to_i
88
-
89
- max.step(min, -BATCH_SIZE).each do |current|
90
- range = [current - BATCH_SIZE, min].max..current
91
- with_confirmed_autosyncability(autosyncable_entries(:id => range).order(:id => :desc), &block)
86
+ current = CommitEntry.maximum(:id).to_i
87
+ while entries = autosyncable_entries("id <= #{current}").limit(BATCH_SIZE).order(:id => :desc).to_a.presence do
88
+ with_confirmed_autosyncability(entries.uniq(&:key), &block)
89
+ current = entries.last.try(:id).to_i - 1
92
90
  end
93
91
  end
94
92
 
@@ -1,3 +1,3 @@
1
1
  module Stagehand
2
- VERSION = "0.13.0"
2
+ VERSION = "0.13.1"
3
3
  end
@@ -1,7 +1,8 @@
1
1
  namespace :stagehand do
2
2
  desc "Polls the commit entries table for changes to sync to production"
3
3
  task :auto_sync, [:delay] => :environment do |t, args|
4
- Stagehand::Staging::Synchronizer.auto_sync(args[:delay] ||= 5.seconds)
4
+ delay = args[:delay].present? ? args[:delay].to_i : 5.seconds
5
+ Stagehand::Staging::Synchronizer.auto_sync(delay)
5
6
  end
6
7
 
7
8
  desc "Syncs records that don't need confirmation to production"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: culturecode_stagehand
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Jakobsen
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-02-02 00:00:00.000000000 Z
12
+ date: 2017-02-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails