Loop faster in the first client loops.

This commit is contained in:
Martin Edenhofer 2012-08-06 06:37:08 +02:00
parent f884ad12f4
commit ead0c54607

View file

@ -325,6 +325,8 @@ class ClientState
end
def fetch
loop_count = 0
while true
# get connection user
@ -334,6 +336,7 @@ class ClientState
user = User.find( user_session[:id] )
return if !user
loop_count += 1
self.log "---client - looking for data of user #{user.id}"
# remember last run
@ -448,10 +451,15 @@ class ClientState
})
end
self.log "---/client-"
# sleep 1
# start faster in the beginnig
if loop_count < 20
sleep 0.4
else
sleep 1
end
end
end
# add ticket if needed
def ticket( ticket_id, tickets, users )