Maybe this fixes the IRC bot?
This commit is contained in:
parent
4b396cd7d7
commit
abf3603bc9
|
@ -3,6 +3,7 @@ import re
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import irc3
|
import irc3
|
||||||
|
from asgiref.sync import sync_to_async
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
|
@ -116,9 +117,10 @@ class Plugin(object):
|
||||||
# logger.debug("inside do_stuff()")
|
# logger.debug("inside do_stuff()")
|
||||||
|
|
||||||
# call the methods we need to
|
# call the methods we need to
|
||||||
self.bot.check_irc_channels()
|
# call them with sync_to_async to be able to access database
|
||||||
self.bot.fix_missing_acls()
|
sync_to_async(self.bot.check_irc_channels)()
|
||||||
self.bot.get_outgoing_messages()
|
sync_to_async(self.bot.fix_missing_acls)()
|
||||||
|
sync_to_async(self.bot.get_outgoing_messages)()
|
||||||
|
|
||||||
# schedule a call of this function again in N seconds
|
# schedule a call of this function again in N seconds
|
||||||
self.bot.loop.call_later(
|
self.bot.loop.call_later(
|
||||||
|
|
Loading…
Reference in a new issue