Add message time logging lock
This commit is contained in:
parent
3684843143
commit
276e112156
|
@ -621,11 +621,14 @@ def getLastMessageTime(channel):
|
|||
if not os.path.isfile(mtpath): return None
|
||||
return dtFromString(open(mtpath,"r").read())
|
||||
|
||||
msgTimeLock = threading.Lock()
|
||||
def setLastMessageTime(channel,time):
|
||||
msgTimeLock.acquire()
|
||||
mtpath = getMessageTimePath(channel)
|
||||
fh = open(mtpath,"w")
|
||||
fh.write(dtToString(time))
|
||||
fh.close()
|
||||
msgTimeLock.release()
|
||||
|
||||
def discordClient(token):
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
|
Loading…
Reference in New Issue