Skip to content

Commit

Permalink
recover from closed loop in case one process runs two discord fetches
Browse files Browse the repository at this point in the history
  • Loading branch information
honzajavorek committed Apr 14, 2021
1 parent ddee3bd commit d82b2a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion juniorguru/fetch/members.py
Expand Up @@ -3,6 +3,7 @@
from urllib.parse import urlparse
from pathlib import Path
from io import BytesIO
import asyncio

import discord
from PIL import Image
Expand Down Expand Up @@ -64,7 +65,7 @@ async def on_error(self, event, *args, **kwargs):

# oauth permissions: manage guild
intents = discord.Intents(guilds=True, members=True)
client = Client(intents=intents)
client = Client(loop=asyncio.new_event_loop(), intents=intents)

exc = None
def exc_handler(loop, context):
Expand Down
3 changes: 2 additions & 1 deletion juniorguru/fetch/messages.py
@@ -1,5 +1,6 @@
import re
import os
import asyncio

import discord

Expand Down Expand Up @@ -83,7 +84,7 @@ async def on_error(self, event, *args, **kwargs):

# oauth permissions: manage guild
intents = discord.Intents(guilds=True, members=True)
client = Client(intents=intents)
client = Client(loop=asyncio.new_event_loop(), intents=intents)

exc = None
def exc_handler(loop, context):
Expand Down

0 comments on commit d82b2a8

Please sign in to comment.