aboutsummaryrefslogtreecommitdiff
path: root/app/linklogger.py
blob: 640cff6cb0a829b018fd1e7af41db719dcf05862 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from routes import app
from db import init_db
import waitress
import threading
import schedule
import time

from func.remove_old_data import remove_old_data

if __name__ == '__main__':
    init_db()
    thread = threading.Thread(target=waitress.serve, args=(app,), kwargs={'port': 5252})
    thread.start()
    print('Server running on port 5252. Healthy.')

    schedule.every().day.at('00:01').do(remove_old_data)
    while True:
        schedule.run_pending()
        time.sleep(1)