コード例 #1
0
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
コード例 #2
0
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))