Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(agent/agentcontainers): add file watcher and dirty status#17573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mafredri merged 23 commits intomainfrommafredri/feat-agent-agentcontainers-watch
Apr 29, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
23 commits
Select commitHold shift + click to select a range
40c8de9
feat(agent/agentcontainers): add file watcher and dirty status
mafredriApr 28, 2025
a997f82
make gen
mafredriApr 28, 2025
0e568fb
fix copilot nits
mafredriApr 28, 2025
4f788d9
log event string in case not write
mafredriApr 28, 2025
bfeb1da
fix chmod on macos
mafredriApr 28, 2025
45a978c
fix close of closed channel
mafredriApr 28, 2025
d2721a7
add close protection to fsnotify watcher as well
mafredriApr 28, 2025
c03bb7d
fix typo
mafredriApr 28, 2025
aed7c30
fix pr suggestions and improve start loop
mafredriApr 28, 2025
39526e6
update noop impl.
mafredriApr 28, 2025
7edee90
s/file/path
mafredriApr 28, 2025
9cf5415
rewrite watcher impl. to watch dirs
mafredriApr 28, 2025
de2a42e
add rename and create to fsnotify test
mafredriApr 28, 2025
0cbee38
add atomic file replacement
mafredriApr 28, 2025
5ced7e1
add paranoid reset
mafredriApr 28, 2025
5a96a55
fix oopsie
mafredriApr 28, 2025
0b16448
s/ErrWatcherClosed/ErrClosed/g
mafredriApr 28, 2025
eaf5922
inverse continue/return for clarity
mafredriApr 28, 2025
617fed2
better close handling
mafredriApr 28, 2025
8ee9914
restore removed comment
mafredriApr 28, 2025
263c683
add note about name
mafredriApr 28, 2025
58a70e8
fix test setup/clock advancement
mafredriApr 28, 2025
9f739ca
outdent
mafredriApr 28, 2025
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
8 changes: 7 additions & 1 deletionagent/agent.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1481,8 +1481,13 @@ func (a *agent) createTailnet(
}()
if err = a.trackGoroutine(func() {
defer apiListener.Close()
apiHandler, closeAPIHAndler := a.apiHandler()
defer func() {
_ = closeAPIHAndler()
}()
server := &http.Server{
Handler: a.apiHandler(),
BaseContext: func(net.Listener) context.Context { return ctx },
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Review: This change allows allr.Contexts to inherit the graceful context from the agent, ensuring cancellation on agent shutdown.

Handler: apiHandler,
ReadTimeout: 20 * time.Second,
ReadHeaderTimeout: 20 * time.Second,
WriteTimeout: 20 * time.Second,
Expand All@@ -1493,6 +1498,7 @@ func (a *agent) createTailnet(
case <-ctx.Done():
case <-a.hardCtx.Done():
}
_ = closeAPIHAndler()
_ = server.Close()
}()

Expand Down
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp