Added re-read of collections at runtime.

This commit is contained in:
Martin Edenhofer 2012-11-12 16:17:39 +01:00
parent 0f418e13e6
commit 3044841bb3

View file

@ -224,7 +224,7 @@ class UserState
self.fetch self.fetch
end end
def fetch def fetch
user = User.find( @user_id ) user = User.find( @user_id )
return if !user return if !user
@ -350,7 +350,7 @@ class UserState
push_collection.each { | key, value | push_collection.each { | key, value |
collections[ key ] = true collections[ key ] = true
} }
CacheIn.set( cache_key, collections ) CacheIn.set( cache_key, collections, { :expires_in => 2.minutes } )
end end
# check all collections to push # check all collections to push
@ -392,9 +392,9 @@ class ClientState
self.fetch self.fetch
self.log 'notify', "---client exiting ws connection---" self.log 'notify', "---client exiting ws connection---"
end end
def fetch def fetch
loop_count = 0 loop_count = 0
while true while true