Skip to content

Commit

Permalink
🐛 fix(bug): NATS function hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
mxchinegod committed Dec 19, 2023
1 parent a038878 commit 8b0d669
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions magnet/ic/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async def on(self, frequency: str = 'default', stream: str = 'default'):
except TimeoutError:
_f('fatal', f'could not connect to {self.server}')
async def off(self):
await self.js.unsubscribe()
await self.sub.unsubscribe()
_f('warn', f'unsubscribed from {self.stream}')
await self.nc.drain()
_f('warn', f'disconnected from {self.server}')
Expand Down Expand Up @@ -62,7 +62,7 @@ async def on(self, frequency: str = 'default', stream: str = 'default', cb=print
except json.decoder.JSONDecodeError:
_f('fatal','invalid JSON')
async def off(self):
await self.js.unsubscribe()
await self.sub.unsubscribe()
_f('warn', f'unsubscribed from {self.stream}')
await self.nc.drain()
_f('warn', f'disconnected from {self.server}')

0 comments on commit 8b0d669

Please sign in to comment.