diff options
| author | 2018-09-29 12:53:39 +0100 | |
|---|---|---|
| committer | 2018-09-29 12:53:39 +0100 | |
| commit | 47ec11bbef27eeefedb26fff678b577c5d50eb17 (patch) | |
| tree | 47a1744ee18da7fc413bc89ef5c05eeefdf22540 /src/IRCBot.py | |
| parent | Make 'account' arg for identify command optional (diff) | |
| signature | ||
Add src/Cache.py, use it in modules/coins.py
Diffstat (limited to 'src/IRCBot.py')
| -rw-r--r-- | src/IRCBot.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/IRCBot.py b/src/IRCBot.py index f4c96627..ff5157cd 100644 --- a/src/IRCBot.py +++ b/src/IRCBot.py @@ -2,12 +2,12 @@ import os, select, sys, threading, time, traceback, uuid from . import EventManager, Exports, IRCLineHandler, IRCServer, Logging from . import ModuleManager - class Bot(object): - def __init__(self, directory, args, config, database, events, exports, - line_handler, log, modules, timers): + def __init__(self, directory, args, cache, config, database, events, + exports, line_handler, log, modules, timers): self.directory = directory self.args = args + self.cache = cache self.config = config self.database = database self._events = events @@ -79,6 +79,7 @@ class Bot(object): timeouts.append(self.next_send()) timeouts.append(self.next_ping()) timeouts.append(self.next_read_timeout()) + timeouts.append(self.cache.next_expiration()) return min([timeout for timeout in timeouts if not timeout == None]) def register_read(self, server): @@ -120,6 +121,7 @@ class Bot(object): self.lock.acquire() events = self.poll.poll(self.get_poll_timeout()) self.timers.call() + self.cache.expire() for fd, event in events: if fd in self.servers: |
