Thorsten Eckel 9 лет назад
Родитель
Сommit
0f95d68cb5
1 измененных файлов с 2 добавлено и 4 удалено
  1. 2 4
      lib/import/otrs.rb

+ 2 - 4
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