This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
actioner/actioner/main.py

24 lines
650 B
Python
Raw Normal View History

import logging
2019-02-14 14:27:04 +00:00
from multiprocessing import Process
from aiohttp.web import run_app as run_web_app
2019-02-14 19:37:17 +00:00
from actioner.scheduler import create_scheduler, start_scheduler
from actioner.settings import LOGGING_LEVEL
2019-02-14 14:27:04 +00:00
from actioner.web import get_server
2019-02-14 14:27:04 +00:00
2019-02-14 13:45:46 +00:00
def main():
logging.basicConfig(level=LOGGING_LEVEL)
2019-02-14 19:37:17 +00:00
2019-02-14 14:27:04 +00:00
server = get_server()
2019-02-14 19:37:17 +00:00
scheduler = create_scheduler()
# HACK: APScheduler doesn't like running in an external event loop. https://github.com/agronholm/apscheduler/issues/360
2019-02-14 19:37:17 +00:00
Process(target=run_web_app, args=(server,)).start()
Process(target=start_scheduler, args=(scheduler,)).start()
2019-02-14 13:45:46 +00:00
if __name__ == '__main__':
main()