Re: Adding import support to Listen
from
ra
on Jul 25, 2008 05:19 PM
Nicholas Bergson-Shilcock wrote:
> Hi all,
>
> I'm working with Robert Marianski to add support for importing mbox
> files into Listen mailing lists. One feature we'd like to support is
> allowing the user to preview some of the messages being imported before
> actually adding them to the list. This seems like an important option
> given the relative ease with which a user could either accidentally
> import the wrong mbox file or try to import corrupt or improperly
> formatted files. The preview feature is intended to act as a guard
> against such mishaps, even though it is less ideal than having a
> full-fledged undo feature.
>
> This requires that we store the messages from the mbox file temporarily
> (otherwise the user would have to upload the entire mbox file twice).
> Does anyone have any thoughts as to where the file should be stored?
> Should we keep things in the ZODB or would it be better to save a
> temporary file?
i'd probably just store the file somewhere. the ZODB is an append-only
database; adding a lot of data to it and then deleting the data is going to
bloat the database size until the next pack happens.
another option is to explicitly use the 'temporary' ZODB database mount, where
session info and other transient data is typically stored. if you do this,
though, you should be aware that the connection is not shared across multiple
ZEO clients... in a load balanced situation, if subsequent requests end up at
a different server things will be broken. of course, this is an issue when
using a temporary file, too, since there's no guarantee that separate ZEO
clients are even on the same physical machine.
if you really want to support persistence, so that someone could start the
operation, walk away midway through, and then come back to finish another day,
a file object in the ZODB is not the end of the world.
-r