diff --git a/lib/coverband/collectors/view_tracker.rb b/lib/coverband/collectors/view_tracker.rb index 7182dfc0..919a80ed 100644 --- a/lib/coverband/collectors/view_tracker.rb +++ b/lib/coverband/collectors/view_tracker.rb @@ -108,7 +108,7 @@ def clear_file!(filename) end def report_views_tracked - redis_store.set(tracker_time_key, Time.now.to_i) unless @one_time_timestamp || redis_store.exists(tracker_time_key) + redis_store.set(tracker_time_key, Time.now.to_i) unless @one_time_timestamp || tracker_time_key_exists? @one_time_timestamp = true reported_time = Time.now.to_i views_to_record.each do |file| @@ -145,6 +145,14 @@ def redis_store store.raw_store end + def tracker_time_key_exists? + if defined?(redis_store.exists?) + redis_store.exists?(tracker_time_key) + else + redis_store.exists(tracker_time_key) + end + end + def tracker_key 'render_tracker_2' end