[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[minion-cvs] Clean queues on startup
Update of /home/minion/cvsroot/src/minion/lib/mixminion/server
In directory moria.mit.edu:/tmp/cvs-serv12563/lib/mixminion/server
Modified Files:
Modules.py ServerMain.py
Log Message:
Clean queues on startup
Index: Modules.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/Modules.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- Modules.py 16 Dec 2002 03:49:19 -0000 1.5
+++ Modules.py 16 Dec 2002 04:01:14 -0000 1.6
@@ -301,7 +301,7 @@
self.queues[module.getName()] = queue
self.enabled[module.getName()] = 1
- def cleanQueue(self):
+ def cleanQueues(self):
"""Remove trash messages from all internal queues."""
for queue in self.queues.values():
queue.cleanQueue()
Index: ServerMain.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/ServerMain.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- ServerMain.py 16 Dec 2002 02:40:11 -0000 1.6
+++ ServerMain.py 16 Dec 2002 04:01:14 -0000 1.7
@@ -263,6 +263,8 @@
f.write("%s\n" % os.getpid())
f.close()
+ self.cleanQueues()
+
now = time.time()
MIX_INTERVAL = 600 # FFFF Configurable!
nextMix = now + MIX_INTERVAL
@@ -299,12 +301,16 @@
if now > nextShred:
# FFFF Configurable shred interval
- LOG.trace("Expunging deleted messages from queues")
- self.incomingQueue.cleanQueue()
- self.mixPool.queue.cleanQueue()
- self.outgoingQueue.cleanQueue()
- self.moduleManager.cleanQueues()
+ self.cleanQueues()
nextShred = now + 6000
+
+ def cleanQueues(self):
+ """Remove all deleted messages from queues"""
+ LOG.trace("Expunging deleted messages from queues")
+ self.incomingQueue.cleanQueue()
+ self.mixPool.queue.cleanQueue()
+ self.outgoingQueue.cleanQueue()
+ self.moduleManager.cleanQueues()
def close(self):
"""Release all resources; close all files."""