Commits

Palmer, 2E0EOL committed 3839d14

Produce some debug information about when the cache was and wasn't used for RSS feeds.

  • Participants
  • Parent commits e889a02
  • Branches develop

Comments (0)

Files changed (1)

 
 sub FeedCache($$) {
 	my ( $Name, $Url ) = @_;
-	my ( $resp, $ret, $ua );
+	my ( $resp, $ua );
 	my $cacheFileName = "$ENV{HOME}/.cache/dlpodget/$Name.rss";
-	return $cacheFileName if ( -f $cacheFileName ); # Already cached.
+	if ( -f $cacheFileName ) { # Already cached.
+		warn "Feed $Name has been satisfied by existing cache - $cacheFileName" if ( $Debug );
+		return $cacheFileName;
+	}
 
 	$Url = URI->new($Url);
 	$ua = LWP::UserAgent->new();
 		warn $resp->status_line;
 		$cacheFileName = undef;
 	}
-	return $cacheFileName || $Url;
+	if ( $cacheFileName ) {
+		warn "Feed $Name has been satisfied by newly written cache file - $cacheFileName" if ( $Debug );
+		return $cacheFileName;
+	}
+	warn "Feed $Name has no cache available" if ( $Debug );
+	return $Url;
 }
 
 sub ReadFeed($$$)