Commit 322808e9 authored by Mindiell's avatar Mindiell

#35 : utilisation d'un nouveau système d'appel du timer pour wantzel.

parent 2a7cce3a
......@@ -9,7 +9,7 @@ Doc : https://wiki.laquadrature.net/Wantzel
import re
from irc import IrcClientFactory
from twisted.internet import reactor
from twisted.internet import reactor, task
import config
from logs import Log
......@@ -37,8 +37,9 @@ class Wantzel(object):
self.irc = IrcClientFactory(config)
self.irc.set_privmsg = self.set_privmsg
reactor.connectTCP(config.server, config.port, self.irc)
# Prepare timer
reactor.callLater(config.timer, self.timer)
# Loop call
self.loop = reactor.LoopingCall(self.timer)
self.loop.start(config.timer)
def timer(self):
"""
......@@ -58,8 +59,6 @@ class Wantzel(object):
self.send_message("#lqdn-travail", self.monitor.wiki_updates())
# Cleaning points of mastering rp
self.rp.clean_master_rp()
# Recalling the timer
reactor.callLater(config.timer, self.timer)
def set_privmsg(self):
"""
......@@ -165,7 +164,7 @@ class Wantzel(object):
if result=="REACTOR":
try:
# Recalling the timer
reactor.callLater(config.timer, self.timer)
self.loop.start(config.timer)
except Exception:
pass
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment