diff options
Diffstat (limited to '')
-rw-r--r-- | lib/feed2imap/feed2imap.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/feed2imap/feed2imap.rb b/lib/feed2imap/feed2imap.rb index a2474be..fcb483e 100644 --- a/lib/feed2imap/feed2imap.rb +++ b/lib/feed2imap/feed2imap.rb @@ -149,6 +149,15 @@ class Feed2Imap end end end + # dump this feed if requested + if feed.dumpdir + mutex.synchronize do + if feed.body + fname = feed.dumpdir + '/' + feed.name + '-' + Time::now.xmlschema + File::open(fname, 'w') { |file| file.puts feed.body } + end + end + end rescue Timeout::Error mutex.synchronize do n = @cache.fetch_failed(feed.name) |