From 591b42e1371c3887b56e0bd2c55a7bca663208fe Mon Sep 17 00:00:00 2001 From: davyd Date: Mon, 15 Mar 2004 03:25:28 +0000 Subject: [PATCH] Cacheability Improvements --- CacheHandler.py | 4 ++-- Changelog | 11 +++++++++++ crontab | 2 +- feedlist | 4 +++- launch-update-planet.sh | 7 +++++-- update-planet | 4 +--- 6 files changed, 23 insertions(+), 9 deletions(-) diff --git a/CacheHandler.py b/CacheHandler.py index 7106279..42070a3 100644 --- a/CacheHandler.py +++ b/CacheHandler.py @@ -36,5 +36,5 @@ class CacheObject: def __init__(self): self.etag = None self.date = None - def __eq__(self, other): - return self.etag == other.etag and self.date == other.date + def __ne__(self, other): + return self.etag != other.etag or self.date != other.date diff --git a/Changelog b/Changelog index ac9fbb7..8b94210 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,14 @@ +2004-03-15 +========== + * update-planet + Cacheability improvements + * crontab + Write output to logfile. + * CacheHandler.py + Add != operator to CacheObject + * launch-update-planet.sh + Cacheability improvements + 2004-03-06 ========== * Added RSS2Writer.py diff --git a/crontab b/crontab index 8f638e7..e1ab6e6 100644 --- a/crontab +++ b/crontab @@ -1 +1 @@ -*/5 * * * * $HOME/projects/planetucc/launch-update-planet.sh 1>/dev/null 2>/dev/null +*/5 * * * * $HOME/projects/planetucc/launch-update-planet.sh 2>&1 > $HOME/projects/planetucc/planet.log diff --git a/feedlist b/feedlist index 4c95681..edd69a5 100644 --- a/feedlist +++ b/feedlist @@ -4,7 +4,9 @@ # name url # Davyd Madeley http://www.livejournal.com/users/davyd/data/rss -Ian McKellar http://ian.mckellar.org/wp-rss2.php +# This feed is broken for caching, also slow +Ian McKellar http://www.livejournal.com/users/loic/data/rss +# Ian McKellar http://ian.mckellar.org/wp-rss2.php # Grahame Bowland http://www.livejournal.com/users/grahame/data/rss Adam Wright http://www.livejournal.com/users/hipikat/data/rss Adrian Chadd http://blog.cacheboy.net/blogs/cacheboy/index.rdf diff --git a/launch-update-planet.sh b/launch-update-planet.sh index f6cd890..284a42e 100755 --- a/launch-update-planet.sh +++ b/launch-update-planet.sh @@ -10,6 +10,9 @@ OLDPWD=`pwd` cd $HOME/projects/planetucc/ ./update-planet -scp planet.html planet@mussel.ucc.asn.au:public-html/index.html -scp rss[12].xml planet@mussel.ucc.asn.au:public-html/ +EXITSTATUS=$? +if [ $EXITSTATUS -eq 0 ]; then + scp planet.html planet@mussel.ucc.asn.au:public-html/index.html + scp rss[12].xml planet@mussel.ucc.asn.au:public-html/ +fi cd $OLDPWD diff --git a/update-planet b/update-planet index 09c40b0..843c4ce 100755 --- a/update-planet +++ b/update-planet @@ -38,9 +38,7 @@ for feed in feeds: blog.feedURL = feed[1] blogs.append(blog) # check the old copy of the cache, vs the new copy - if feed[2].cache == blog.cache: - pass - else: + if not feed[2] or not feed[2].cache or not blog or not blog.cache or feed[2].cache != blog.cache: tainted = True # write the cache back down to disk cache.storeBlog(blog) -- 2.20.1