Skip to content

Commit 40c8de9

Browse files
committed
feat(agent/agentcontainers): add file watcher and dirty status
Fixes coder/internal#479 Fixes coder/internal#480
1 parent e0483e3 commit 40c8de9

File tree

11 files changed

+714
-48
lines changed

11 files changed

+714
-48
lines changed

agent/agent.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1481,8 +1481,10 @@ func (a *agent) createTailnet(
14811481
}()
14821482
if err = a.trackGoroutine(func() {
14831483
defer apiListener.Close()
1484+
apiHandler, closeAPIHAndler := a.apiHandler()
14841485
server := &http.Server{
1485-
Handler: a.apiHandler(),
1486+
BaseContext: func(net.Listener) context.Context { return ctx },
1487+
Handler: apiHandler,
14861488
ReadTimeout: 20 * time.Second,
14871489
ReadHeaderTimeout: 20 * time.Second,
14881490
WriteTimeout: 20 * time.Second,
@@ -1493,6 +1495,7 @@ func (a *agent) createTailnet(
14931495
case <-ctx.Done():
14941496
case <-a.hardCtx.Done():
14951497
}
1498+
_ = closeAPIHAndler()
14961499
_ = server.Close()
14971500
}()
14981501

0 commit comments

Comments
 (0)