From: Caesar Date: Wed, 14 May 2014 20:24:50 +0000 (+0200) Subject: (irssi-feed) Fix eternally hanging feeds X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=095f8617c57dd1175ed65c0e244b451156ead689;p=irssi-scripts.irssi.org.git (irssi-feed) Fix eternally hanging feeds --- diff --git a/scripts/irssi-feed.pl b/scripts/irssi-feed.pl index fedfc42..2753ba8 100644 --- a/scripts/irssi-feed.pl +++ b/scripts/irssi-feed.pl @@ -20,7 +20,7 @@ use List::Util qw(min); use IO::Socket::INET; use Errno; use Getopt::Long qw(GetOptionsFromString); -our $VERSION = "20130916"; +our $VERSION = "20140514"; our %IRSSI = ( authors => 'Julius Michaelis', contact => 'iRRSi@liftm.de', # see also: JCaesar on freenode, probably idling in #irssi @@ -235,8 +235,8 @@ sub feed_check { if(($now - $feed->{lastcheck}) > $feed->{timeout}) { if($feed->{io}->{failed} >= 3) { $feed->{timeout} = valid_timeout($feed->{timeout} * 2); + $feed->{io}->{failed} -= 2; $feed->{generation} += 1; # so the "Skipped n feed entries" message won't hang forever - return 0; } feedprint("Warning, stall feed " . feed_stringrepr($feed)) if($feed->{io}->{conn}); feed_cleanup_conn($feed, 1); @@ -433,6 +433,7 @@ sub feed_stringrepr { (($feed->{name} ne $feed->{uri}) ? (" (" .$feed->{uri}. ")") : "") . ($feed->{active} ? " ":" in")."active, " . $feed->{timeout} ."s" . + " (next in " . int($feed->{lastcheck} + $feed->{timeout} - clock_gettime(CLOCK_MONOTONIC)) . "s)" . ($feed->{channel} ? ' (printed to ' . $feed->{channel} . '@' . $feed->{servtag} . ')' : ''); } else { return ($feed->{color} && !$nocolor ? $feed->{color} : '') .