Corrected with rubocop cop 'Style/InfiniteLoop'.

This commit is contained in:
Thorsten Eckel 2015-05-05 16:10:06 +02:00
parent c3122f6234
commit d63b9d2f9b
5 changed files with 5 additions and 7 deletions

View file

@ -262,8 +262,6 @@ Lint/UnreachableCode:
Enabled: false Enabled: false
Lint/ShadowingOuterLocalVariable: Lint/ShadowingOuterLocalVariable:
Enabled: false Enabled: false
Style/InfiniteLoop:
Enabled: false
Lint/Eval: Lint/Eval:
Enabled: false Enabled: false
Style/ModuleFunction: Style/ModuleFunction:

View file

@ -120,7 +120,7 @@ class LongPollingController < ApplicationController
# set max loop time to 24 sec. because of 30 sec. timeout of mod_proxy # set max loop time to 24 sec. because of 30 sec. timeout of mod_proxy
count = 12 count = 12
while true loop do
count = count - 1 count = count - 1
queue = Sessions.queue( client_id ) queue = Sessions.queue( client_id )
if queue && queue[0] if queue && queue[0]

View file

@ -7,7 +7,7 @@ class Scheduler < ApplicationModel
Thread.abort_on_exception = true Thread.abort_on_exception = true
jobs_started = {} jobs_started = {}
while true loop do
logger.info "Scheduler running (runner #{runner} of #{runner_count})..." logger.info "Scheduler running (runner #{runner} of #{runner_count})..."
# reconnect in case db connection is lost # reconnect in case db connection is lost
@ -34,7 +34,7 @@ class Scheduler < ApplicationModel
Thread.new { Thread.new {
if job.period if job.period
while true loop do
self._start_job( job, runner, runner_count ) self._start_job( job, runner, runner_count )
job = Scheduler.lookup( id: job.id ) job = Scheduler.lookup( id: job.id )

View file

@ -505,7 +505,7 @@ returns
end end
Thread.abort_on_exception = true Thread.abort_on_exception = true
while true loop do
client_ids = self.sessions client_ids = self.sessions
client_ids.each { |client_id| client_ids.each { |client_id|

View file

@ -21,7 +21,7 @@ class Sessions::Client
backend_pool = [] backend_pool = []
user_id_last_run = nil user_id_last_run = nil
loop_count = 0 loop_count = 0
while true loop do
# get connection user # get connection user
session_data = Sessions.get( @client_id ) session_data = Sessions.get( @client_id )