Skip to content

Commit

Permalink
Ensure periodic callback cleanup does not error on session warmup (#6886
Browse files Browse the repository at this point in the history
)
  • Loading branch information
philippjfr authored May 31, 2024
1 parent 60ff9b1 commit fe8f811
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions panel/io/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,12 @@ def stop(self):
with param.discard_events(self):
self.counter = 0
self._timeout = None
if state._is_pyodide:
if state._is_pyodide and self._cb:
self._cb.cancel()
elif self._doc:
elif self._doc and self._cb:
if self._doc._session_context:
self._doc.callbacks.remove_session_callback(self._cb)
else:
elif self._cb in self._doc.callbacks.session_callbacks:
self._doc.callbacks._session_callbacks.remove(self._cb)
elif self._cb:
self._cb.stop()
Expand Down

0 comments on commit fe8f811

Please sign in to comment.