Skip to content

Increase polling frequency#63

Merged
nathanjcochran merged 11 commits intomainfrom
nathan/increase-polling-frequency
Oct 16, 2025
Merged

Increase polling frequency#63
nathanjcochran merged 11 commits intomainfrom
nathan/increase-polling-frequency

Conversation

@nathanjcochran
Copy link
Member

@nathanjcochran nathanjcochran commented Oct 15, 2025

This PR increases the polling frequency when creating or deleting services from every 10 seconds to every 1 second.

Additionally, to avoid spamming the console with lots of Service status: QUEUED... messages (which were previously output every time we polled), I implemented a more dynamic status message that updates in real-time and shows a little loading spinner thingy:

Screen.Recording.2025-10-15.at.6.11.34.PM.mov

If the output is not a tty, it doesn't try to render the dynamic loading spinner/message, but instead prints the status message on a new line every time the message changes. This is to prevent weird terminal control characters from showing up in the output when it's redirected to a file.

I also fixed some buggy and duplicate error output.

Closes AGE-188

@nathanjcochran nathanjcochran self-assigned this Oct 15, 2025
Copy link
Member

@murrayju murrayju left a comment

Choose a reason for hiding this comment

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

Looks good, one minor comment

fmt.Fprintln(s.output, s.model.View())
}

func isTerminal(w io.Writer) bool {
Copy link
Member

Choose a reason for hiding this comment

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

I wrote a similar function for the version check stuff. Should consolidate these.

Reviewing on mobile, too hard to provide a link, sorry.

Copy link
Member Author

@nathanjcochran nathanjcochran Oct 16, 2025

Choose a reason for hiding this comment

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

Good call! Done here: ac42720.

I decided to rely on the official golang.org/x/term package rather than the github.com/mattn/go-isatty package you were using. I think the functionality should be essentially the same, but I trust the official package slightly more.

@nathanjcochran nathanjcochran force-pushed the nathan/increase-polling-frequency branch from 309d8c0 to 26dd0ca Compare October 16, 2025 04:25
@nathanjcochran nathanjcochran force-pushed the nathan/increase-polling-frequency branch from 26dd0ca to ac42720 Compare October 16, 2025 04:33
@nathanjcochran nathanjcochran merged commit 863f334 into main Oct 16, 2025
2 checks passed
@nathanjcochran nathanjcochran deleted the nathan/increase-polling-frequency branch October 16, 2025 04:53
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.

2 participants