import asyncio
import time
import logging
from datetime import datetime, timedelta, date
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from apscheduler.schedulers.blocking import BlockingScheduler

scheduler = AsyncIOScheduler({
    'apscheduler.jobstores.default': {
        'type': 'sqlalchemy',
        'url': f'mysql+pymysql://Quentin:kaPl0wskii@192.168.1.52:5618/discord_bot?charset=utf8mb4'
    },
    'apscheduler.executors.default': {
        'class': 'apscheduler.executors.pool:ThreadPoolExecutor',
        'max_workers': '20'
    },
    'apscheduler.executors.processpool': {
        'type': 'processpool',
        'max_workers': '5'
    },
    'apscheduler.job_defaults.coalesce': 'true',
    'apscheduler.job_defaults.max_instances': '3',
    'apscheduler.timezone': 'America/Chicago',
})

scheduler.start()

async def hello():
    print("hello world")


if __name__ == '__main__':
    # scheduler.add_job(hello, 'date', run_date=datetime.now()+timedelta(seconds=20))

    try:
        asyncio.get_event_loop().run_forever()
    except (KeyboardInterrupt, SystemExit):
        pass
