From 0f95d68cb56fade31708ff46c14756ead23ce717 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Tue, 21 Jul 2015 13:14:44 +0200 Subject: [PATCH] Proper infinite loop. --- lib/import/otrs.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/import/otrs.rb b/lib/import/otrs.rb index deeee2604..9102b5dd0 100644 --- a/lib/import/otrs.rb +++ b/lib/import/otrs.rb @@ -382,9 +382,8 @@ module Import::OTRS Thread.current[:thread_no] = thread sleep thread * 3 log "Started import thread# #{thread} ..." - run = true steps = 20 - while run + loop do count += steps log "loading... thread# #{thread} ..." offset = count - steps @@ -394,8 +393,7 @@ module Import::OTRS records = load( 'Ticket', steps, count - steps) if !records || !records[0] log "... thread# #{thread}, no more work." - run = false - next + break end _ticket_result(records, locks, thread) end