From 3c882ab5a145b0166611714131aa130386b287ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Wed, 15 Apr 2020 21:25:51 +0200 Subject: More info for cleaning channels --- bin/feed2imap-cleaner | 7 ++++++- lib/feed2imap/cache.rb | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/feed2imap-cleaner b/bin/feed2imap-cleaner index b616585..af7b99c 100755 --- a/bin/feed2imap-cleaner +++ b/bin/feed2imap-cleaner @@ -45,11 +45,13 @@ if docache end before = cache.nbchannels + keys_before = cache.channels puts "Cleaning up" cache.cleanup(config.feeds) after = cache.nbchannels + keys_after = cache.channels if not dryrun puts "Saving cache ..." @@ -61,11 +63,14 @@ if docache begin File::rename("#{config.cache}.new", config.cache) rescue - puts"Exception caught while renaming #{@config.cache}.new to #{@config.cache}: #{$!}" + puts "Exception caught while renaming #{@config.cache}.new to #{@config.cache}: #{$!}" end end puts "#Channels before: #{before}, after: #{after}" + (keys_before - keys_after).each do |c| + puts "Removed channel #{c}" + end else config.imap_accounts.each_value do |ac| ac.connect diff --git a/lib/feed2imap/cache.rb b/lib/feed2imap/cache.rb index 9c5977c..44af62c 100644 --- a/lib/feed2imap/cache.rb +++ b/lib/feed2imap/cache.rb @@ -91,6 +91,11 @@ class ItemCache Marshal.dump([@@cacheidx, @channels], io) end + # Keys of the channels + def channels + @channels.keys + end + # Return the number of channels in the cache def nbchannels @channels.length -- cgit v1.2.3