mirror of
https://github.com/kurbezz/discord-bot.git
synced 2026-03-03 13:40:48 +01:00
Update
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
from typing import Self
|
from typing import Self
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
import logging
|
||||||
|
|
||||||
from httpx import AsyncClient
|
from httpx import AsyncClient
|
||||||
from pydantic import BaseModel, field_serializer, SerializationInfo
|
from pydantic import BaseModel, field_serializer, SerializationInfo
|
||||||
@@ -9,6 +10,9 @@ from config import config
|
|||||||
from services.scheduler_sync.twitch_events import TwitchEvent
|
from services.scheduler_sync.twitch_events import TwitchEvent
|
||||||
|
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class RecurrenceRule(BaseModel):
|
class RecurrenceRule(BaseModel):
|
||||||
start: datetime
|
start: datetime
|
||||||
by_weekday: list[int]
|
by_weekday: list[int]
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
from asyncio import sleep
|
from asyncio import sleep
|
||||||
|
import logging
|
||||||
|
|
||||||
from services.scheduler_sync.twitch_events import get_twitch_events, TwitchEvent
|
from services.scheduler_sync.twitch_events import get_twitch_events, TwitchEvent
|
||||||
from services.scheduler_sync.discord_events import (
|
from services.scheduler_sync.discord_events import (
|
||||||
@@ -10,6 +11,9 @@ from services.scheduler_sync.discord_events import (
|
|||||||
from services.scheduler_sync.comparators import compare
|
from services.scheduler_sync.comparators import compare
|
||||||
|
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
async def add_events(
|
async def add_events(
|
||||||
twitch_events: list[tuple[str, TwitchEvent]],
|
twitch_events: list[tuple[str, TwitchEvent]],
|
||||||
discord_events: list[tuple[str, DiscordEvent]]
|
discord_events: list[tuple[str, DiscordEvent]]
|
||||||
@@ -86,6 +90,6 @@ async def start_synchronizer():
|
|||||||
try:
|
try:
|
||||||
await syncronize()
|
await syncronize()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error: {e}")
|
logging.error(e)
|
||||||
|
|
||||||
await sleep(5 * 30)
|
await sleep(5 * 30)
|
||||||
|
|||||||
Reference in New Issue
Block a user