Moved to loadAssets event.
This commit is contained in:
parent
438baa1231
commit
d1c7a0f29f
1 changed files with 11 additions and 13 deletions
|
@ -31,9 +31,9 @@ class Sessions::Client
|
||||||
# remember last run
|
# remember last run
|
||||||
Sessions::CacheIn.set( 'last_run_' + user.id.to_s , true, { :expires_in => 20.seconds } )
|
Sessions::CacheIn.set( 'last_run_' + user.id.to_s , true, { :expires_in => 20.seconds } )
|
||||||
|
|
||||||
# verify already pushed data
|
# verify already pushed data, send update if needed
|
||||||
if !Sessions::CacheIn.get( 'pushed_users' + @client_id.to_s )
|
if !Sessions::CacheIn.get( 'pushed_users' + @client_id.to_s )
|
||||||
Sessions::CacheIn.set( 'pushed_users' + @client_id.to_s , true, { :expires_in => 20.seconds } )
|
Sessions::CacheIn.set( 'pushed_users' + @client_id.to_s , true, { :expires_in => 60.seconds } )
|
||||||
if @pushed[:users]
|
if @pushed[:users]
|
||||||
users = {}
|
users = {}
|
||||||
@pushed[:users].each {|user_id, user_o|
|
@pushed[:users].each {|user_id, user_o|
|
||||||
|
@ -46,19 +46,19 @@ class Sessions::Client
|
||||||
# send update to browser
|
# send update to browser
|
||||||
self.send({
|
self.send({
|
||||||
:data => {
|
:data => {
|
||||||
:collections => {
|
User.to_app_model => users,
|
||||||
User.to_app_model => users,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
:event => [ 'loadCollection', 'ticket_overview_rebuild' ],
|
:event => [ 'loadAssets' ],
|
||||||
});
|
});
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# verify already pushed data
|
|
||||||
|
|
||||||
|
# verify already pushed data, send update if needed
|
||||||
if !Sessions::CacheIn.get( 'pushed_tickets' + @client_id.to_s )
|
if !Sessions::CacheIn.get( 'pushed_tickets' + @client_id.to_s )
|
||||||
Sessions::CacheIn.set( 'pushed_tickets' + @client_id.to_s , true, { :expires_in => 20.seconds } )
|
Sessions::CacheIn.set( 'pushed_tickets' + @client_id.to_s , true, { :expires_in => 60.seconds } )
|
||||||
if @pushed[:tickets]
|
if @pushed[:tickets]
|
||||||
tickets = {}
|
tickets = {}
|
||||||
users = {}
|
users = {}
|
||||||
|
@ -72,12 +72,10 @@ class Sessions::Client
|
||||||
# send update to browser
|
# send update to browser
|
||||||
self.send({
|
self.send({
|
||||||
:data => {
|
:data => {
|
||||||
:collections => {
|
Ticket.to_app_model => tickets,
|
||||||
Ticket.to_app_model => tickets,
|
User.to_app_model => users,
|
||||||
User.to_app_model => users,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
:event => [ 'loadCollection', 'ticket_overview_rebuild' ],
|
:event => [ 'loadAssets' ],
|
||||||
});
|
});
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue