Removed extended logging.

This commit is contained in:
Martin Edenhofer 2015-05-10 21:54:57 +02:00
parent c8ae1d38e1
commit 9e3a68762d
4 changed files with 1 additions and 36 deletions

View file

@ -492,19 +492,14 @@ returns
key = "#{new.class.name}_latest_change"
updated_at = Cache.get( key )
logger.debug "request latest_change for #{key}/#{updated_at}"
# if we do not have it cached, do lookup
if !updated_at
o = select(:updated_at).order(updated_at: :desc).limit(1).first
logger.debug "result latest_change #{o.inspect}"
if o
updated_at = o.updated_at
latest_change_set(updated_at)
end
logger.debug "lookup latest_change for #{key}/#{updated_at}"
end
logger.debug "return latest_change for #{key}/#{updated_at}"
updated_at
end

View file

@ -15,17 +15,10 @@ class Sessions::Backend::TicketOverviewIndex
current_user: @user,
)
if !overview || overview.empty?
Rails.logger.debug "ERR no overview for #{@user.inspect}/#{overview.isnpect}"
end
# no data exists
return if !overview
# no change exists
if @last_change == overview
Rails.logger.debug "ERR @last_change == overview #{@user.inspect}/#{overview.isnpect}"
end
return if @last_change == overview
# remember last state
@ -40,10 +33,6 @@ class Sessions::Backend::TicketOverviewIndex
def push
if Sessions::CacheIn.get( client_key )
Rails.logger.debug "ERR CACHE FILLED #{@client_key}"
end
# check check interval
return if Sessions::CacheIn.get( client_key )
@ -52,13 +41,11 @@ class Sessions::Backend::TicketOverviewIndex
# check if min one ticket has changed
last_ticket_change = Ticket.latest_change
Rails.logger.debug "ERR last_ticket_change #{last_ticket_change}"
return if last_ticket_change == @last_ticket_change
@last_ticket_change = last_ticket_change
# load current data
data = load
Rails.logger.debug "ERR push/load #{data.inspect}"
return if !data

View file

@ -24,15 +24,12 @@ class Sessions::Backend::TicketOverviewList
data = { list: overview_data, index: overview }
result.push data
}
if !result || result.empty?
Rails.logger.debug "LOG A PROBLEM #{result.inspect} / #{@last_change}"
end
# no data exists
return if !result || result.empty?
# no change exists
return if @last_change == result
Rails.logger.debug "LOG B #{result.inspect}"
# remember last state
@last_change = result
@ -47,26 +44,18 @@ class Sessions::Backend::TicketOverviewList
def push
# check interval
if Sessions::CacheIn.get( client_key )
Rails.logger.debug "LOG 1 CACH KEY EXISTS #{@user.inspect}"
end
return if Sessions::CacheIn.get( client_key )
# reset check interval
Rails.logger.debug "LOG 2 #{@ttl.seconds}"
Sessions::CacheIn.set( client_key, true, { expires_in: @ttl.seconds } )
# check if min one ticket has changed
last_ticket_change = Ticket.latest_change
if last_ticket_change == @last_ticket_change
Rails.logger.debug "LOG 3 #{last_ticket_change}/#{@last_ticket_change}"
end
return if last_ticket_change == @last_ticket_change
@last_ticket_change = last_ticket_change
# load current data
items = load
Rails.logger.debug "LOG 4 set new from load #{items.inspect}"
return if !items
# push overviews

View file

@ -32,9 +32,6 @@ class SessionBasicTicketTest < ActiveSupport::TestCase
# get as stream
result1 = client1.push
if !result1
Rails.logger.error "FAILD Sessions::Backend::TicketOverviewIndex push"
end
assert( result1, 'check ticket_overview_index' )
# next check should be empty / no changes
@ -84,9 +81,6 @@ class SessionBasicTicketTest < ActiveSupport::TestCase
# get as stream
result1 = client1.push
if !result1
Rails.logger.error "FAILD Sessions::Backend::TicketOverviewList push"
end
assert( result1, 'check ticket_overview_list' )
# next check should be empty / no changes