From 3044841bb3eff61564aa47f48556b99cfdf041bd Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 12 Nov 2012 16:17:39 +0100 Subject: [PATCH] Added re-read of collections at runtime. --- lib/web_socket.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/web_socket.rb b/lib/web_socket.rb index 28312e4af..5af5f7d0f 100644 --- a/lib/web_socket.rb +++ b/lib/web_socket.rb @@ -224,7 +224,7 @@ class UserState self.fetch end - + def fetch user = User.find( @user_id ) return if !user @@ -350,7 +350,7 @@ class UserState push_collection.each { | key, value | collections[ key ] = true } - CacheIn.set( cache_key, collections ) + CacheIn.set( cache_key, collections, { :expires_in => 2.minutes } ) end # check all collections to push @@ -392,9 +392,9 @@ class ClientState self.fetch self.log 'notify', "---client exiting ws connection---" end - + def fetch - + loop_count = 0 while true