diff --git a/handlers/mainHandler.py b/handlers/mainHandler.py index ef44d2d..dea0bd0 100644 --- a/handlers/mainHandler.py +++ b/handlers/mainHandler.py @@ -50,6 +50,7 @@ import traceback class handler(requestHelper.asyncRequestHandler): def asyncPost(self): + glob.meme.acquire() try: # Track time if needed if glob.requestTime == True: @@ -57,7 +58,7 @@ class handler(requestHelper.asyncRequestHandler): st = datetime.datetime.now() # Client's token string and request data - requestTokenString = self.request.headers.get('osu-token') + requestTokenString = self.request.headers.get("osu-token") requestData = self.request.body # Server's token string and request data @@ -191,6 +192,7 @@ class handler(requestHelper.asyncRequestHandler): discordBotHelper.sendConfidential(msg) finally: self.finish() + glob.meme.release() def asyncGet(self): html = "
" diff --git a/objects/glob.py b/objects/glob.py index 17fc34d..b15945e 100644 --- a/objects/glob.py +++ b/objects/glob.py @@ -3,6 +3,7 @@ from objects import tokenList from objects import channelList from objects import matchList +import threading VERSION = "0.9" @@ -16,3 +17,4 @@ memes = True restarting = False pool = None requestTime = False +meme = threading.Lock()