culturecode_stagehand 0.7.17 → 0.7.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stagehand/staging/synchronizer.rb +10 -7
- data/lib/stagehand/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58df2083dd4f1a0fc7f3d4c1c1778d0acf941473
|
4
|
+
data.tar.gz: 20225cec28769c77e6a46ab8d012eff9a94ca10a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbc3a5779ace87420c2341ab705d727e4cb187717a8cdfb30e2d3a78ea19fb8d60b7d3ac96839f6a31915dd7036b0aa2c39dc35ea092c7c460dea0952a6ce686
|
7
|
+
data.tar.gz: 2dc328dced0b5f6207c59c08e49b573aee592818b13205fdf535ddf6db65c555fd89b2b08c1d8fff65426d6f4a3e8b85e15a49b27a2e1375d99387890afde386
|
@@ -5,6 +5,7 @@ module Stagehand
|
|
5
5
|
mattr_accessor :schemas_match
|
6
6
|
|
7
7
|
BATCH_SIZE = 1000
|
8
|
+
SESSION_BATCH_SIZE = 30
|
8
9
|
|
9
10
|
# Immediately attempt to sync the changes from the block if possible
|
10
11
|
# The block is wrapped in a transaction to prevent changes to records while being synced
|
@@ -72,14 +73,16 @@ module Stagehand
|
|
72
73
|
# Lazily iterate through millions of commit entries
|
73
74
|
# Returns commit entries in ID descending order
|
74
75
|
def iterate_autosyncable_entries(&block)
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
autosyncable_entries(:session => sessions
|
80
|
-
|
76
|
+
session_list = CommitEntry.order(:id => :desc).distinct.pluck(:session)
|
77
|
+
|
78
|
+
while sessions = session_list.shift(SESSION_BATCH_SIZE).presence
|
79
|
+
offset = 0
|
80
|
+
while entries = autosyncable_entries(:session => sessions).offset(offset).limit(BATCH_SIZE).uniq(&:id).presence
|
81
|
+
offset += BATCH_SIZE
|
82
|
+
entries.each do |entry|
|
83
|
+
with_confirmed_autosyncability(entry, &block)
|
84
|
+
end
|
81
85
|
end
|
82
|
-
offset += BATCH_SIZE
|
83
86
|
end
|
84
87
|
end
|
85
88
|
|
data/lib/stagehand/version.rb
CHANGED
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.7.
|
4
|
+
version: 0.7.18
|
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: 2016-08-
|
12
|
+
date: 2016-08-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|