Improved re-push of changed and already pushed data.
This commit is contained in:
parent
419ed6571c
commit
17de3107d4
1 changed files with 40 additions and 34 deletions
|
@ -447,6 +447,8 @@ class ClientState
|
||||||
CacheIn.set( 'last_run_' + user.id.to_s , true, { :expires_in => 20.seconds } )
|
CacheIn.set( 'last_run_' + user.id.to_s , true, { :expires_in => 20.seconds } )
|
||||||
|
|
||||||
# verify already pushed data
|
# verify already pushed data
|
||||||
|
if !CacheIn.get( 'pushed_users' + @client_id.to_s )
|
||||||
|
CacheIn.set( 'pushed_users' + @client_id.to_s , true, { :expires_in => 15.seconds } )
|
||||||
if @pushed[:users]
|
if @pushed[:users]
|
||||||
users = {}
|
users = {}
|
||||||
@pushed[:users].each {|user_id, user_o|
|
@pushed[:users].each {|user_id, user_o|
|
||||||
|
@ -467,8 +469,11 @@ class ClientState
|
||||||
});
|
});
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# verify already pushed data
|
# verify already pushed data
|
||||||
|
if !CacheIn.get( 'pushed_tickets' + @client_id.to_s )
|
||||||
|
CacheIn.set( 'pushed_tickets' + @client_id.to_s , true, { :expires_in => 15.seconds } )
|
||||||
if @pushed[:tickets]
|
if @pushed[:tickets]
|
||||||
tickets = []
|
tickets = []
|
||||||
users = {}
|
users = {}
|
||||||
|
@ -476,8 +481,8 @@ class ClientState
|
||||||
self.ticket( ticket_id, tickets, users )
|
self.ticket( ticket_id, tickets, users )
|
||||||
}
|
}
|
||||||
if !tickets.empty?
|
if !tickets.empty?
|
||||||
tickets.each {|ticket_id|
|
tickets.each {|ticket|
|
||||||
self.log 'notify', "push update of already pushed ticket id #{ticket_id}"
|
self.log 'notify', "push update of already pushed ticket id #{ticket['id']}"
|
||||||
}
|
}
|
||||||
# send update to browser
|
# send update to browser
|
||||||
self.send({
|
self.send({
|
||||||
|
@ -491,6 +496,7 @@ class ClientState
|
||||||
});
|
});
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# overview
|
# overview
|
||||||
cache_key = @cache_key + '_overview'
|
cache_key = @cache_key + '_overview'
|
||||||
|
|
Loading…
Reference in a new issue