Venus cache expunge

Sam Ruby rubys at intertwingly.net
Thu Mar 1 02:54:02 EST 2007


Morten Frederiksen wrote:
> Hi all,
> 
>> From the current TODO for Venus @ 
>> http://intertwingly.net/code/venus/TODO :
>  * Expire feed history
>    The feed cache doesn't currently expire old entries, so could get
>    large quite rapidly.  We should probably have a config setting for
>    the cache expiry, the trouble is some channels might need a longer
>    or shorter one than others.

I will note that that page bears a striking similarity to:

   http://www.gnome.org/~jdub/bzr/planet/2.0/TODO

> I've started to code a "expungePlanet" along the lines of the
> following pseudo-code, but I would appreciate it if you all could let
> me know if there are conflicting requirements out there...
> 
> For each entry file in cache (in reverse timestamp order)
>  Determine source
>  Update entry count for source
>  If entry count for source greater than maximum
>    Delete entry file from cache
> 
> A few notes and special cases:
> * Maximum is per feed configuration setting (keep_entries) or global
> configuration setting or 10
> * Entries without a determinable source are never deleted
> * Entries from sources that are no longer in the subscription list are
> always deleted

The interesting question to ask is whether number of entries per source 
or a date range is more apropos to the problem at hand.  With Venus, the 
latter can be handled via techniques such as the following:

   find cache -mtime +30 | xargs -r rm

None of this should be construed as disparagement.  If code such as the 
above is written, is accompanied with unit tests, and a mention is added 
to the docs, I'll certainly merge it into my branch.

- Sam Ruby


More information about the devel mailing list