After the recent JAOO developer conference I had a chance to write two lines of code, something that I haven't done in a few years.
We're going away next week for six days for a holiday. We have one every three or four years. The last one was when we came back from Peru in 2004. Anyways, I may not have internet access, so I can't be molly coddling the Planet ISKCON server and code.
I spent some time tuning the Apache instance so that the server doesn't run out of memory and go into swap death (you've noticed that it sometimes disappears?).
I also modified the Planet code to make it more robust. You've noticed that Planet ISKCON will sometimes not update for a few hours, up to a day? It's because a cache file somehow becomes corrupted. Each feed has a cache, so that Planet doesn't have to download the content every hour, just the new stuff. When a feed's cache file becomes corrupted, it chokes the whole job. When that happens, at to this point, I manually run the cron job, identify the culprit from the stack trace, and delete the cache file by hand.
Now what I did was identify the call that opens the cache file, and put it in a try...except block that will delete the cache file on a failure, and retry:
__init__.py:
cache_filename = cache.filename(planet.cache_directory, url)
try:
cache_file = dbhash.open(cache_filename, "c", 0666)
except:
os.remove(cache_filename)
cache_file = dbhash.open(cache_filename, "c", 0666) If the second call fails, it will still bomb out - but this will make it more robust.





Recent comments
6 hours 26 min ago
6 hours 32 min ago
11 hours 57 min ago
13 hours 46 min ago
14 hours 7 min ago
16 hours 11 min ago
16 hours 42 min ago
19 hours 47 min ago
19 hours 53 min ago
1 day 54 min ago