8000 refactor(agent): update agentcontainers api initialization by mafredri · Pull Request #17600 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

refactor(agent): update agentcontainers api initialization #17600

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Apr 29, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
rename ready to signalready
  • Loading branch information
mafredri committed Apr 29, 2025
commit 4a5842b5f899b6704ee12741b25c87837012f121
2 changes: 1 addition & 1 deletion agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ func (a *agent) handleManifest(manifestOK *checkpoint) func(ctx context.Context,
// Inform the container API that the agent is ready.
// This allows us to start watching for changes to
// the devcontainer configuration files.
a.containerAPI.Ready()
a.containerAPI.SignalReady()
}
})
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions agent/agentcontainers/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ func NewAPI(logger slog.Logger, options ...Option) *API {
return api
}

// Ready signals the API that we are ready to begin watching for file
// changes. This is used to prime the cache with the current list of
// containers and to start watching the devcontainer config files for
// SignalReady signals the API that we are ready to begin watching for
// file changes. This is used to prime the cache with the current list
// of containers and to start watching the devcontainer config files for
// changes. It should be called after the agent ready.
func (api *API) Ready() {
func (api *API) SignalReady() {
// Prime the cache with the current list of containers.
_, _ = api.cl.List(api.ctx)

Expand Down
2 changes: 1 addition & 1 deletion agent/agentcontainers/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ func TestAPI(t *testing.T) {
)
defer api.Close()

api.Ready()
api.SignalReady()

r := chi.NewRouter()
r.Mount("/", api.Routes())
Expand Down
Loading
0