2023-03-22 18:22:43 +03:00
|
|
|
import uvicorn
|
|
|
|
from server import app
|
|
|
|
from daemon.SimpleDaemon import Daemon
|
2023-03-21 23:58:22 +03:00
|
|
|
|
|
|
|
|
2023-03-22 18:22:43 +03:00
|
|
|
class CdnServerDaemon(Daemon):
|
|
|
|
def run(self):
|
2023-03-22 18:36:20 +03:00
|
|
|
uvicorn.run("server:app", host='0.0.0.0', port=5044, log_level="info")
|
2023-03-21 23:58:22 +03:00
|
|
|
|
|
|
|
|
|
|
|
# Press the green button in the gutter to run the script.
|
|
|
|
if __name__ == '__main__':
|
2023-03-22 18:36:20 +03:00
|
|
|
# uvicorn.run("server:app", host='0.0.0.0', port=5044, log_level="info")
|
2023-03-22 18:22:43 +03:00
|
|
|
with CdnServerDaemon('/tmp/daemon-cdn-server.pid', error_log_file='errlog.txt') as daemon:
|
|
|
|
daemon.process_command()
|
2023-03-21 23:58:22 +03:00
|
|
|
|
|
|
|
# See PyCharm help at https://www.jetbrains.com/help/pycharm/
|