Skip to content

fix(mount): reduce websocket polling overhead#45

Merged
khaliqgant merged 1 commit intomainfrom
fix/mount-websocket-polling
Apr 17, 2026
Merged

fix(mount): reduce websocket polling overhead#45
khaliqgant merged 1 commit intomainfrom
fix/mount-websocket-polling

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

@khaliqgant khaliqgant commented Apr 17, 2026

Summary

  • wire the fsnotify file watcher into the relayfile mount CLI path so local writes sync on change instead of requiring the two-second scan loop
  • skip no-op polling cycles while websocket mode is active, leaving periodic reconciliation every 10 intervals
  • apply the same quiet-cycle behavior to the standalone relayfile-mount poll mode

Tests

  • go test ./...

Open with Devin

@khaliqgant khaliqgant merged commit 34f6fce into main Apr 17, 2026
6 checks passed
@khaliqgant khaliqgant deleted the fix/mount-websocket-polling branch April 17, 2026 13:33
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread cmd/relayfile-cli/main.go
Comment on lines 1651 to +1653
reconcile := !websocketEnabled || cycle%websocketReconcileEvery == 0
_ = runCycle(reconcile)
if reconcile {
_ = runCycle(true)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant