This commit is contained in:
2024-08-10 18:50:54 +02:00
parent 3baf53ca76
commit 1400092b86
2 changed files with 9 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
from typing import Self
from datetime import datetime, timedelta
import logging
from httpx import AsyncClient
from pydantic import BaseModel, field_serializer, SerializationInfo
@@ -9,6 +10,9 @@ from config import config
from services.scheduler_sync.twitch_events import TwitchEvent
logger = logging.getLogger(__name__)
class RecurrenceRule(BaseModel):
start: datetime
by_weekday: list[int]

View File

@@ -1,4 +1,5 @@
from asyncio import sleep
import logging
from services.scheduler_sync.twitch_events import get_twitch_events, TwitchEvent
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
logger = logging.getLogger(__name__)
async def add_events(
twitch_events: list[tuple[str, TwitchEvent]],
discord_events: list[tuple[str, DiscordEvent]]
@@ -86,6 +90,6 @@ async def start_synchronizer():
try:
await syncronize()
except Exception as e:
print(f"Error: {e}")
logging.error(e)
await sleep(5 * 30)