def getLatestTidLocal (eventName, increment=1): #Should be atomic for a specific event but now its a global lock mutex.acquire () if increment == 1: dbMgr.incTid (eventName) x = dbMgr.getLatestTid (eventName) mutex.release () app.logger.debug ('getLatestTidLocal : ' + str(x)) return x
def getLatestTid (eventName): #Should be atomic for a specific event but now its a global lock mutex.acquire () increment = request.form ['inputParam'] if (increment == str(1)): dbMgr.incTid (eventName) x = dbMgr.getLatestTid (eventName) mutex.release () app.logger.debug ('getLatestTid : ' + str(x)) return jsonify (tid = str(x))