Skip to content

Commit

Permalink
Set the event in proper (and less) places
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackenmen authored Dec 24, 2024
1 parent 5a19214 commit ffd97b6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions redbot/cogs/audio/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ async def shutdown(self) -> None:

async def _partial_shutdown(self) -> None:
self.ready.clear()
self.downloaded.clear()
if self._shutdown is True:
# For convenience, calling this method more than once or calling it before starting it
# does nothing.
Expand Down Expand Up @@ -479,15 +480,13 @@ async def _is_up_to_date(self):
async def maybe_download_jar(self):
if not self.lavalink_jar_file.exists():
log.info("Triggering first-time download of Lavalink...")
self.downloaded.clear()
await self._download_jar()
return

try:
up_to_date = await self._is_up_to_date()
except ValueError as exc:
log.warning("Failed to get Lavalink version: %s\nTriggering update...", exc)
self.downloaded.clear()
await self._download_jar()
return

Expand All @@ -497,7 +496,6 @@ async def maybe_download_jar(self):
self._lavalink_version,
managed_node.JAR_VERSION,
)
self.downloaded.clear()
await self._download_jar()
else:
self.downloaded.set()
Expand All @@ -517,6 +515,7 @@ async def start_monitor(self, java_path: str):
self._shutdown = False
if self._proc is None or self._proc.returncode is not None:
self.ready.clear()
self.downloaded.clear()
await self._start(java_path=java_path)
while True:
await self.wait_until_ready(timeout=self.timeout)
Expand Down

0 comments on commit ffd97b6

Please sign in to comment.