@@ -828,7 +828,16 @@ class LocationBot(ircbot.SingleServerIRCBot):
else:
self.connection.part(channel)
+ ping_next = datetime.utcnow() + timedelta(minutes = 1)
+
while not self.__reloading:
+ now = datetime.utcnow()
+ if now >= ping_next:
+ self.connection.ping(self.connection.server)
+ ping_next = now + timedelta(minutes = 1)
if self.__locations_lock.acquire(False):
if self.__locations and self.__channels.issubset(self.channels.keys()):
for nick, channel, granularity, location, coordinates, accuracy, speed, heading, altitude, altitude_accuracy in self.__locations: