Skip to content

Commit f9d3c23

Browse files
committedDec 19, 2024··
#419 exit if too old
1 parent 6b60796 commit f9d3c23

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed
 

‎lib/incremate.rb

+4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
# Incrementaly accumulates data into a fact, using Ruby scripts
3232
# found in the directory provided, by the prefix.
3333
def Jp.incremate(fact, dir, prefix)
34+
if Time.now - $start > 15 * 60
35+
$loog.info('We are busy for too long already, won\'t run incremate')
36+
return
37+
end
3438
start = Time.now
3539
Dir[File.join(dir, "#{prefix}_*.rb")].each do |rb|
3640
n = File.basename(rb).gsub(/\.rb$/, '')

‎test/test__helper.rb

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def load_it(judge, fb, options = Judges::Options.new({ 'repositories' => 'foo/fo
4343
$judge = judge
4444
$options = options
4545
$loog = Loog::NULL
46+
$start = Time.now
4647
load(File.join(__dir__, "../judges/#{judge}/#{judge}.rb"))
4748
end
4849

0 commit comments

Comments
 (0)
Please sign in to comment.