fix(mount): reduce websocket polling overhead#45
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc28b73eeb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| reconcile := !websocketEnabled || cycle%websocketReconcileEvery == 0 | ||
| _ = runCycle(reconcile) | ||
| if reconcile { | ||
| _ = runCycle(true) |
There was a problem hiding this comment.
Keep polling when websocket transport is disconnected
When --websocket is enabled, this branch skips nine out of ten timer ticks entirely, so no sync runs on those ticks. That regresses fallback behavior: if websocket setup fails or later disconnects, SyncOnce is no longer called each interval to poll (sync only polls when wsConn == nil), so local uploads and remote pulls can be delayed by up to websocketReconcileEvery*interval instead of the configured interval. This same pattern is also present in cmd/relayfile-mount/main.go, so both entrypoints throttle polling even when websocket is unavailable.
Useful? React with 👍 / 👎.
Summary
Tests