Monday: WorkingWiki

Publish Date: 
Mon, 03/28/2011 - 22:31

When people preview their work in the wikis, we create a copy of the WW working directory so that the files they're previewing are kept separate from the saved version of the files. When they save we take care of the copies, but when they decide to abandon their changes we get stuck with copies of directories hanging around forever. Background jobs and plain old persistent project directories can also get "orphaned" and need to be cleared away, but the preview sessions are the ones that pile up fast and thick.

I finally put in some code to clear them away. It checks all the modification and access times in the directory and if all of them are more than 7 days past, prunes it from the cache.

Next I need to learn about MediaWiki's job queue so I can schedule the prune operation to happen every once in a while when nobody's asking for a web page.

I also need to clarify when it's all right to erase persistent and background directories: I wrote to the workingwiki-users list asking advice about that.

[Note: I know these software development notes don't really belong in an Open Lab Notebook, but I'm finding it really useful to record my output every day.]

Post new comment

Drupal theme by Kiwi Themes.