fbe 0.0.81 → 0.0.82
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fbe/iterate.rb +10 -2
- data/lib/fbe.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51fe0b687df4a15c1472d3a88588801a8d8c000be7004f0d8537de7e1813ace5
|
4
|
+
data.tar.gz: cbb8890bdc7c56264a3d9e316c0d4b682ec230a234323f3ce23efbf703ea4a36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 926492d589e6740135445210ae19dbaa60b99b3cb9fecdbdead14002fa4865eb98c0d35ab9e86b976c6cbc4809884ce0a24c6476a3622163bc141c0180b7dae0
|
7
|
+
data.tar.gz: d43ea58b294e127c1d016b678de8a63e69d09ca1e28c69267a92a8b018a2ae54b32b177eefce41af1e1cdb4824f3308983d616aac85421b27bed6f51f59350b9
|
data/lib/fbe/iterate.rb
CHANGED
@@ -22,6 +22,8 @@
|
|
22
22
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
23
23
|
# SOFTWARE.
|
24
24
|
|
25
|
+
require 'tago'
|
26
|
+
require 'time'
|
25
27
|
require_relative '../fbe'
|
26
28
|
require_relative 'fb'
|
27
29
|
require_relative 'octo'
|
@@ -114,17 +116,23 @@ class Fbe::Iterate
|
|
114
116
|
# +query+. The query is supplied with two parameter:
|
115
117
|
# +$before+ the value from the previous repeat and +$repository+ (GitHub repo ID).
|
116
118
|
#
|
119
|
+
# @param [Float] timeout How many seconds to spend as a maximum
|
117
120
|
# @yield [Array<Integer, Integer>] Repository ID and the next number to be considered
|
118
121
|
# @return [nil] Nothing
|
119
|
-
def over(&)
|
122
|
+
def over(timeout: 2 * 60, &)
|
120
123
|
raise 'Use "as" first' if @label.nil?
|
121
124
|
raise 'Use "by" first' if @query.nil?
|
122
125
|
seen = {}
|
123
126
|
oct = Fbe.octo(loog: @loog, options: @options, global: @global)
|
124
127
|
repos = Fbe.unmask_repos(loog: @loog, options: @options, global: @global)
|
125
128
|
restarted = []
|
129
|
+
start = Time.now
|
126
130
|
loop do
|
127
131
|
repos.each do |repo|
|
132
|
+
if Time.now - start > timeout
|
133
|
+
$loog.info("We are doing this for #{start.ago} already, won't check #{repo}")
|
134
|
+
next
|
135
|
+
end
|
128
136
|
next if restarted.include?(repo)
|
129
137
|
seen[repo] = 0 if seen[repo].nil?
|
130
138
|
if seen[repo] >= @repeats
|
@@ -179,6 +187,6 @@ class Fbe::Iterate
|
|
179
187
|
break
|
180
188
|
end
|
181
189
|
end
|
182
|
-
@loog.debug("Finished scanning #{repos.size} repos: #{seen.map { |k, v| "#{k}:#{v}" }.join(', ')}")
|
190
|
+
@loog.debug("Finished scanning #{repos.size} repos in #{start.ago}: #{seen.map { |k, v| "#{k}:#{v}" }.join(', ')}")
|
183
191
|
end
|
184
192
|
end
|
data/lib/fbe.rb
CHANGED