fix cancelled bug
This commit is contained in:
@@ -89,21 +89,22 @@ class GuildLogs:
|
|||||||
return self.locked and self.log_file not in current_analysis
|
return self.locked and self.log_file not in current_analysis
|
||||||
|
|
||||||
def lock(self) -> bool:
|
def lock(self) -> bool:
|
||||||
self.locked = True
|
|
||||||
current_analysis_lock.acquire()
|
current_analysis_lock.acquire()
|
||||||
if self.log_file in current_analysis:
|
if self.log_file in current_analysis:
|
||||||
current_analysis_lock.release()
|
current_analysis_lock.release()
|
||||||
return False
|
return False
|
||||||
|
self.locked = True
|
||||||
current_analysis.append(self.log_file)
|
current_analysis.append(self.log_file)
|
||||||
current_analysis_lock.release()
|
current_analysis_lock.release()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def unlock(self):
|
def unlock(self):
|
||||||
self.locked = False
|
if self.locked:
|
||||||
current_analysis_lock.acquire()
|
self.locked = False
|
||||||
if self.log_file in current_analysis:
|
current_analysis_lock.acquire()
|
||||||
current_analysis.remove(self.log_file)
|
if self.log_file in current_analysis:
|
||||||
current_analysis_lock.release()
|
current_analysis.remove(self.log_file)
|
||||||
|
current_analysis_lock.release()
|
||||||
|
|
||||||
async def load(
|
async def load(
|
||||||
self,
|
self,
|
||||||
|
|||||||
Reference in New Issue
Block a user