diff --git a/bridge_master.py b/bridge_master.py index 070f07f..4d19295 100755 --- a/bridge_master.py +++ b/bridge_master.py @@ -493,11 +493,7 @@ def threadIdent(): def threadedMysql(): logger.debug('(MYSQL) Starting MySQL thread') - if not mysql_sema.acquire(blocking = False): - logger.debug('(MYSQL) Previous thread is still running (can\'t acquire semaphore). Try next iteration') - return reactor.callInThread(mysqlGetConfig) - mysql_sema.release() def ident(): for system in systems: @@ -1886,7 +1882,6 @@ if __name__ == '__main__': #Mysql config checker #This runs in a thread so as not to block the reactor if CONFIG['MYSQL']['USE_MYSQL'] == True: - mysql_sema = Semaphore(value=1) mysql_task = task.LoopingCall(threadedMysql) mysql = mysql_task.start(30) mysql.addErrback(loopingErrHandle) diff --git a/hblink.py b/hblink.py index aba51cf..7c066ed 100755 --- a/hblink.py +++ b/hblink.py @@ -35,7 +35,6 @@ from hashlib import sha256, sha1 from hmac import new as hmac_new, compare_digest from time import time from collections import deque -from threading import Semaphore # Twisted is pretty important, so I keep it separate from twisted.internet.protocol import DatagramProtocol, Factory, Protocol