Loop faster in the first client loops.
This commit is contained in:
parent
f884ad12f4
commit
ead0c54607
1 changed files with 10 additions and 2 deletions
|
@ -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,8 +451,13 @@ class ClientState
|
|||
})
|
||||
end
|
||||
self.log "---/client-"
|
||||
# sleep 1
|
||||
sleep 1
|
||||
|
||||
# start faster in the beginnig
|
||||
if loop_count < 20
|
||||
sleep 0.4
|
||||
else
|
||||
sleep 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue