fbe 0.0.81 → 0.0.82

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fbe/iterate.rb +10 -2
  3. data/lib/fbe.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e26093b2b5ac0b46c1eed7e6e28f221b0f16ac3bd3c52cc0220762c7a212379e
4
- data.tar.gz: fc9fc6f37787d0b511679466305a93c4f1ee5b58182c68561fbc68c147cd2916
3
+ metadata.gz: 51fe0b687df4a15c1472d3a88588801a8d8c000be7004f0d8537de7e1813ace5
4
+ data.tar.gz: cbb8890bdc7c56264a3d9e316c0d4b682ec230a234323f3ce23efbf703ea4a36
5
5
  SHA512:
6
- metadata.gz: a91972dea782ad66a1869e5847d30250a61bad2f28b87c37ae0eecfb82dea785680358aabe349aa70b63cc9cc3698554361b504a29c67c72cf08cd13653af6a6
7
- data.tar.gz: 268ed0efdce0ab23c20078156366b1698053e06e4c6ab66abdd630f74deb3885411a17d4cba572593ee45025b57a63d9fa9ca221853f1a6253f1f5563588e1fd
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
@@ -27,5 +27,5 @@
27
27
  # License:: MIT
28
28
  module Fbe
29
29
  # Current version of the gem (changed by +.rultor.yml+ on every release)
30
- VERSION = '0.0.81'
30
+ VERSION = '0.0.82'
31
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fbe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.81
4
+ version: 0.0.82
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko