mirror of
https://github.com/fosrl/olm.git
synced 2026-05-06 02:37:55 -05:00
[PR #93] refactor(retry): remove sleep-based waits from websocket and peer tes… #95
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fosrl/olm/pull/93
Author: @LaurenceJJones
Created: 2/11/2026
Status: 🔄 Open
Base:
main← Head:remove-time-sleep-functions📝 Commits (1)
b71d2a9refactor(retry): remove sleep-based waits from websocket and peer test loops📊 Changes
2 files changed (+84 additions, -84 deletions)
View changed files
📝
peers/monitor/wgtester.go(+51 -48)📝
websocket/client.go(+33 -36)📄 Description
…t loops
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description
I dont know if
time.sleepwas chosen for a reason, but this function blocks the function in which it is invoked, these for loops are context aware meaning if context is cancelled we should be responsive to this information. Using a ticker instead means we can use a select statement where we wait for either ticker or the context cancellation.How to test?
Tough as more a refactor, but when context is cancelled each timeout should respect the context as using
time.sleepfunction blocks the goroutine meaning responsiveness to the cancellation is delayed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.