Stability update

This commit is contained in:
Rafael Vargas
2022-07-25 09:49:04 -03:00
parent f27dc1de93
commit 140c1640d9
16 changed files with 41 additions and 20 deletions

View File

@@ -113,13 +113,20 @@ class PlayHandler(AbstractHandler):
tasks.append(task)
# In the original order, await for the task and then if successfully downloaded add in the playlist
processManager = ProcessManager()
for index, task in enumerate(tasks):
await task
song = songs[index]
if not song.problematic: # If downloaded add to the playlist and send play command
with processInfo.getLock():
processInfo = processManager.getPlayerInfo(self.guild, self.ctx)
processLock = processInfo.getLock()
acquired = processLock.acquire(timeout=self.config.ACQUIRE_LOCK_TIMEOUT)
if acquired:
playlist.add_song(song)
queue.put(playCommand)
processLock.release()
else:
processManager.resetProcess(self.guild, self.ctx)
def __isUserConnected(self) -> bool:
if self.ctx.author.voice: