[prev in list] [next in list] [prev in thread] [next in thread]
List: spambayes-dev
Subject: [spambayes-dev] Re: [Spambayes-checkins]
From: tameyer () ihug ! co ! nz (Tony Meyer)
Date: 2003-12-31 16:46:02
Message-ID: 1ED4ECF91CDED24C8D012BCF2B034F13026F2A20 () its-xchg4 ! massey ! ac ! nz
[Download RAW message or body]
> This edit keeps appearing and disappearing. Mark removed
> that line in order to fix the fact that none of sb_server's
> command line arguments worked. Tony has now put it back in
> order to fix a restart problem, which has once again broken
> all the command line arguments.
Opps. Sorry, I must try and pay more attention...
> Does anyone have a clear idea of what each of prepare(),
> State.__init__(), State.init(), and State.prepare() are all
> intended to do? I think the command line option code needs
> to be inserted somewhere into one of them, but I'm not 100%
> sure what each of them is for.
I'm not sure about intent, but this is what they currently do:
__init__(): calls init()
init(): opens the log file
sets up the list of servers/ports
loads options from configuration file
resets statistics
prepare(): opens mutex
(and in calling createWorkers())
opens db
opens the corpora
creates the trainers
Should init() be only done once for every time that sb_server is run, and
prepare() each time it is started/stopped? In that case it should be:
__init__(): calls init()
init(): opens the log file
loads options from configuration file
resets statistics
prepare(): opens mutex
sets up the list of servers/ports
(and in calling createWorkers())
opens db
opens the corpora
creates the trainers
This makes prepare() a kind of anti-close(). This is probably the fix I
should have applied - moving setting up the list of servers/ports to
prepare() instead of calling init() again. It needs to be done *sometime*
after close(), though, and before the call to createWorkers(). Whether the
log file and statistics should be reset on start/stop, I don't know, but I
suspect not. This would mean that the command-line code could be anywhere
between __init__() and prepare().
+1 to docstrings for init() and prepare(), though :)
=Tony Meyer
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic