Skip to content

Commit

Permalink
added requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ITz-Viks authored and olijeffers0n committed Jun 7, 2023
1 parent 6b3509e commit d8067bd
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions rustplus/api/remote/rustws.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,18 @@ async def connect(
self.connection = await connect(address, close_timeout=0, ping_interval=None)
self.connected_time = time.time()

if asyncio.iscoroutinefunction(self.on_success):
await self.on_success()
else:
try:
self.on_success()
except TypeError:
pass
try:
if self.on_success is not None:
if asyncio.iscoroutinefunction(self.on_success):
await self.on_success()
else:
self.on_success()

except Exception as e:
self.logger.warning(e)

break

except Exception as exception:
print_error = True

Expand Down

0 comments on commit d8067bd

Please sign in to comment.