Proper infinite loop.

This commit is contained in:
Thorsten Eckel 2015-07-21 13:14:44 +02:00
parent f5bc738170
commit 0f95d68cb5

View file

@ -382,9 +382,8 @@ module Import::OTRS
Thread.current[:thread_no] = thread Thread.current[:thread_no] = thread
sleep thread * 3 sleep thread * 3
log "Started import thread# #{thread} ..." log "Started import thread# #{thread} ..."
run = true
steps = 20 steps = 20
while run loop do
count += steps count += steps
log "loading... thread# #{thread} ..." log "loading... thread# #{thread} ..."
offset = count - steps offset = count - steps
@ -394,8 +393,7 @@ module Import::OTRS
records = load( 'Ticket', steps, count - steps) records = load( 'Ticket', steps, count - steps)
if !records || !records[0] if !records || !records[0]
log "... thread# #{thread}, no more work." log "... thread# #{thread}, no more work."
run = false break
next
end end
_ticket_result(records, locks, thread) _ticket_result(records, locks, thread)
end end