Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@

__version__ = "0.1.0"

# Module-level guard: prevent duplicate WSS auto-start when the plugin is
# installed in multiple locations (e.g. global + profile). The first
# ``register()`` that runs sets this True; subsequent calls no-op.
_auto_start_done = False

def register(ctx) -> None:
"""Hermes plugin entry point.

Expand Down Expand Up @@ -165,6 +170,12 @@ def _log(msg: str) -> None:
except Exception:
pass

global _auto_start_done
if _auto_start_done:
_log("auto-start already handled by another registration, skipping")
return
_auto_start_done = True

_log("auto-start check running")

if os.environ.get("HERMES_NODES_AUTO_START", "1") == "1":
Expand Down
Loading