better saving

This commit is contained in:
AF 2022-11-08 05:14:39 +00:00
parent b3601bfbf3
commit 7fe4ce0e23
3 changed files with 4 additions and 2 deletions

View File

@ -124,7 +124,6 @@ class QueueAudio(discord.AudioSource):
return stream.getvalue() return stream.getvalue()
def cleanup(self): def cleanup(self):
self.queue.clear()
for audio in self.queue: for audio in self.queue:
try: try:
audio.cleanup() audio.cleanup()

View File

@ -12,6 +12,8 @@ from v6d3music.utils.tor_prefix import tor_prefix
adaas_available = bool(os.getenv('adaasurl')) adaas_available = bool(os.getenv('adaasurl'))
if adaas_available:
print('running real_url through adaas')
async def real_url(url: str, override: bool, tor: bool) -> str: async def real_url(url: str, override: bool, tor: bool) -> str:

View File

@ -28,11 +28,12 @@ register_commands()
class MusicClient(discord.Client): class MusicClient(discord.Client):
async def close(self) -> None: async def close(self) -> None:
save_task.cancel() save_task.cancel()
await super().close()
try: try:
await save_all(False, False) await save_all(False, False)
print('saved')
except Exception: except Exception:
traceback.print_exc() traceback.print_exc()
await super().close()
client = MusicClient( client = MusicClient(
intents=discord.Intents( intents=discord.Intents(