MCPcopy Index your code
hub / github.com/coder/coder / checkBuildIsLatest

Function checkBuildIsLatest

coderd/workspaceagentsrpc.go:501–510  ·  view source on GitHub ↗
(ctx context.Context, db database.Store, build database.WorkspaceBuild)

Source from the content-addressed store, hash-verified

499}
500
501func checkBuildIsLatest(ctx context.Context, db database.Store, build database.WorkspaceBuild) error {
502 latestBuild, err := db.GetLatestWorkspaceBuildByWorkspaceID(ctx, build.WorkspaceID)
503 if err != nil {
504 return err
505 }
506 if build.ID != latestBuild.ID {
507 return xerrors.New("build is outdated")
508 }
509 return nil
510}
511
512// WorkspaceAgentRPCMetrics holds Prometheus metrics for the agent
513// connection monitor. It is nil when Prometheus is not enabled.

Callers 1

monitorMethod · 0.85

Calls 2

NewMethod · 0.65

Tested by

no test coverage detected