Skip to content

Commit

Permalink
skip if too long
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Dec 19, 2024
1 parent 1704aee commit cc07d5e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions judges/find-all-issues/find-all-issues.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
require 'fbe/who'
require 'fbe/issue'

start = Time.now
Fbe.iterate do
as 'min-issue-was-found'
by "(agg (and (eq where 'github') (eq repository $repository) (eq what 'issue-was-opened')) (min issue))"
Expand All @@ -41,8 +42,12 @@
rescue Octokit::NotFound
next 0
end
if Time.now - start > 5 * 60
$loog.info("We are doing this for #{start.ago} already, won't check #{repo}")
next issue
end
total = 0
start = Time.now
before = Time.now
Fbe.octo.search_issues("repo:#{repo} type:issue created:<=#{after.iso8601[0..9]}")[:items].each do |json|
total += 1
f =
Expand All @@ -57,7 +62,7 @@
f.who = json.dig(:user, :id)
f.details = "The issue #{Fbe.issue(f)} has been opened by #{Fbe.who(f)}."
end
$loog.info("Checked #{total} issues in #{repo} in #{start.ago}")
$loog.info("Checked #{total} issues in #{repo} in #{before.ago}")
issue
end
end

0 comments on commit cc07d5e

Please sign in to comment.