From e959c0fe4c887154bbe28c31324fef2975cbe467 Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Wed, 25 Apr 2012 17:15:49 +0100 Subject: Big update. * Max acknowledgement time is now specified in the config * Calendar interface improved. * holiday_url no longer used -- replaced by notify_when_on_holiday! * added notify_when_off_sick! * Added ability for the calendar to be queried for a list of bank holdays. * Added ability for Time to be given a list of bank holidays to check against. * PeopleLists can now be a Proc, allowing downloading of lists * Person is no longer a struct * Moved the method_missing bit into ObjectBuilder from various sub classes. * Added tests for the calendar interface * Updated tests in other bits. --- lib/mauve/processor.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'lib/mauve/processor.rb') diff --git a/lib/mauve/processor.rb b/lib/mauve/processor.rb index 0ac7b59..acf72b3 100644 --- a/lib/mauve/processor.rb +++ b/lib/mauve/processor.rb @@ -57,14 +57,11 @@ module Mauve to_delete = [] - @transmission_id_cache.each do |tid, received_at| - to_delete << tid if (now - received_at) > @transmission_cache_expire_time + @transmission_id_cache = @transmission_id_cache.delete_if do |cache_data| + tid, received_at = cache_data + (now - received_at) > @transmission_cache_expire_time end - to_delete.each do |tid| - @transmission_id_cache.delete(tid) - end - @transmission_cache_checked_at = now end @@ -197,6 +194,11 @@ module Mauve sz.times do process_packet(*Server.packet_pop) end + + # + # Now expire the cache. This will only get processed at most once every minute. + # + expire_transmission_id_cache end def timer_should_stop? -- cgit v1.2.1