From 9e3a68762daee4bf492bfafba7e4625481240a6f Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sun, 10 May 2015 21:54:57 +0200 Subject: [PATCH] Removed extended logging. --- app/models/application_model.rb | 5 ----- lib/sessions/backend/ticket_overview_index.rb | 13 ------------- lib/sessions/backend/ticket_overview_list.rb | 13 +------------ test/unit/session_basic_ticket_test.rb | 6 ------ 4 files changed, 1 insertion(+), 36 deletions(-) diff --git a/app/models/application_model.rb b/app/models/application_model.rb index 86b187062..1b3648616 100644 --- a/app/models/application_model.rb +++ b/app/models/application_model.rb @@ -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 diff --git a/lib/sessions/backend/ticket_overview_index.rb b/lib/sessions/backend/ticket_overview_index.rb index e2bffebac..2936e240f 100644 --- a/lib/sessions/backend/ticket_overview_index.rb +++ b/lib/sessions/backend/ticket_overview_index.rb @@ -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 diff --git a/lib/sessions/backend/ticket_overview_list.rb b/lib/sessions/backend/ticket_overview_list.rb index 978cb6115..ab4c861a0 100644 --- a/lib/sessions/backend/ticket_overview_list.rb +++ b/lib/sessions/backend/ticket_overview_list.rb @@ -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 diff --git a/test/unit/session_basic_ticket_test.rb b/test/unit/session_basic_ticket_test.rb index 6836cf2a2..2899a8403 100644 --- a/test/unit/session_basic_ticket_test.rb +++ b/test/unit/session_basic_ticket_test.rb @@ -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