Cacheability Improvements
authordavyd <davyd>
Mon, 15 Mar 2004 03:25:28 +0000 (03:25 +0000)
committerdavyd <davyd>
Mon, 15 Mar 2004 03:25:28 +0000 (03:25 +0000)
CacheHandler.py
Changelog
crontab
feedlist
launch-update-planet.sh
update-planet

index 7106279..42070a3 100644 (file)
@@ -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
index ac9fbb7..8b94210 100644 (file)
--- 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 (file)
--- 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
index 4c95681..edd69a5 100644 (file)
--- 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
index f6cd890..284a42e 100755 (executable)
@@ -10,6 +10,9 @@
 OLDPWD=`pwd`
 cd $HOME/projects/planetucc/
 ./update-planet
-scp planet.html [email protected]:public-html/index.html
-scp rss[12].xml [email protected]:public-html/
+EXITSTATUS=$?
+if [ $EXITSTATUS -eq 0 ]; then
+       scp planet.html [email protected]:public-html/index.html
+       scp rss[12].xml [email protected]:public-html/
+fi
 cd $OLDPWD
index 09c40b0..843c4ce 100755 (executable)
@@ -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)

UCC git Repository :: git.ucc.asn.au