Deleted unneeded file

This commit is contained in:
Igor Nurullaev
2019-08-28 18:22:05 +03:00
parent 6c3af9382d
commit 09ea798e38

View File

@@ -1,55 +0,0 @@
import threading
import atexit
from flask import Flask
from server import *
POOL_TIME = 0 # Seconds
class ServerThread(threading.Thread):
def run(self):
server = Server()
server.start()
while True:
pass
# variables that are accessible from anywhere
commonDataStruct = {}
# lock to control access to variable
dataLock = threading.Lock()
# thread handler
yourThread = ServerThread()
def create_app():
app = Flask(__name__)
def interrupt():
global yourThread
yourThread.cancel()
def doStuff():
global commonDataStruct
global yourThread
with dataLock:
print('kek')
yourThread = threading.Timer(POOL_TIME, doStuff, ())
yourThread.start()
def doStuffStart():
# Do initialisation stuff here
global yourThread
# Create your thread
yourThread = threading.Timer(POOL_TIME, doStuff, ())
yourThread.start()
# Initiate
doStuffStart()
# When you kill Flask (SIGTERM), clear the trigger for the next thread
atexit.register(interrupt)
return app
app = create_app()
app.run(host='0.0.0.0', debug=True)