Improved error handling.

This commit is contained in:
Martin Edenhofer 2013-09-23 00:43:27 +02:00
parent 1e97dcafb0
commit ef6f5ef78f

View file

@ -20,7 +20,7 @@ module Sessions::Backend::Collections
# check all collections to push # check all collections to push
push_collection = {} push_collection = {}
collections.each { | key, v | collections.each { | key, v |
cache_key = 'user_' + user.id.to_s + '_push_collections_' + key cache_key = 'user_' + user.id.to_s + '_push_collections_' + key.to_s
if Sessions::CacheIn.expired(cache_key) if Sessions::CacheIn.expired(cache_key)
if push_collection.empty? if push_collection.empty?
push_collection = SessionHelper::push_collections(user) push_collection = SessionHelper::push_collections(user)
@ -45,7 +45,7 @@ module Sessions::Backend::Collections
collections = Sessions::CacheIn.get( cache_key ) || {} collections = Sessions::CacheIn.get( cache_key ) || {}
collections.each { | key, v | collections.each { | key, v |
collection_cache_key = 'user_' + user.id.to_s + '_push_collections_' + key collection_cache_key = 'user_' + user.id.to_s + '_push_collections_' + key.to_s
collection_time = Sessions::CacheIn.get_time( collection_cache_key, { :ignore_expire => true } ) collection_time = Sessions::CacheIn.get_time( collection_cache_key, { :ignore_expire => true } )
if collection_time && @@last_change[ user.id ][ key ] != collection_time if collection_time && @@last_change[ user.id ][ key ] != collection_time