mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2024-11-10 21:55:11 +01:00
Fix message dequeueing
This commit is contained in:
parent
cf043c2fa5
commit
6fc380d2c8
@ -641,11 +641,14 @@ class Broker(SocketServer.UDPServer):
|
|||||||
|
|
||||||
def dequeue_old_messages(self):
|
def dequeue_old_messages(self):
|
||||||
now = time.mktime(time.localtime())
|
now = time.mktime(time.localtime())
|
||||||
|
to_delete = 0
|
||||||
|
|
||||||
for msg in self.messages:
|
for msg in self.messages:
|
||||||
diff = now - msg.get_timestamp()
|
diff = now - msg.get_timestamp()
|
||||||
# Older than one day?
|
# Older than one day?
|
||||||
if diff > 24 * 60 * 60:
|
if diff > 24 * 60 * 60:
|
||||||
del msg
|
to_delete = to_delete + 1
|
||||||
|
self.messages = self.messages[ to_delete : ]
|
||||||
|
|
||||||
def ping_all_peers(self):
|
def ping_all_peers(self):
|
||||||
"""Ping all peers (to see that they are alive)"""
|
"""Ping all peers (to see that they are alive)"""
|
||||||
|
Loading…
Reference in New Issue
Block a user