From 6c66892373037b318398f6347139eabc089ff8f6 Mon Sep 17 00:00:00 2001 From: Adam Sampson Date: Tue, 19 Aug 2008 15:09:32 +0000 Subject: [PATCH] Only update etag and modified if the feed changed. --- NEWS | 2 ++ rawdoglib/rawdog.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 33e9d88..ceaa890 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ their replacements are. - rawdog 2.12 +Only update the stored Etag and Last-Modified when a feed changes. + Add the "splitstate" option, which makes rawdog use a separate state file for each feed rather than one large one. This significantly reduces rawdog's memory usage at the cost of some more disk IO during --write. diff --git a/rawdoglib/rawdog.py b/rawdoglib/rawdog.py index 47724bb..dc36ded 100644 --- a/rawdoglib/rawdog.py +++ b/rawdoglib/rawdog.py @@ -402,15 +402,15 @@ class Feed: decode_structure(p, p.get("encoding") or "UTF-8") - self.etag = p.get("etag") - self.modified = p.get("modified") - # In the event that the feed hasn't changed, then both channel # and feed will be empty. In this case we return 0 so that # we know not to expire articles that came from this feed. if len(p["entries"]) == 0: return False + self.etag = p.get("etag") + self.modified = p.get("modified") + self.feed_info = p["feed"] feed = self.url -- 2.35.1