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

Commit1b4157b

Browse files
committed
docs
1 parent788b2f9 commit1b4157b

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

‎agent/agent.go

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,8 +1115,13 @@ func (a *agent) handleManifest(manifestOK *checkpoint) func(ctx context.Context,
11151115
}
11161116
}
11171117

1118+
// Any defined Dev Containers may be autostarted after the start
1119+
// scripts have completed.
11181120
varpostStartScripts []codersdk.WorkspaceAgentScript
11191121
for_,dc:=rangemanifest.Devcontainers {
1122+
// TODO(mafredri): Verify `@devcontainers/cli` presence.
1123+
// TODO(mafredri): Verify workspace folder exists.
1124+
// TODO(mafredri): If set, verify config path exists.
11201125
postStartScripts=append(postStartScripts,agentcontainers.DevcontainerStartupScript(dc))
11211126
}
11221127

@@ -1126,11 +1131,18 @@ func (a *agent) handleManifest(manifestOK *checkpoint) func(ctx context.Context,
11261131
}
11271132
err=a.trackGoroutine(func() {
11281133
start:=time.Now()
1129-
// here we use the graceful context because the script runner is not directly tied
1130-
// to the agent API.
1134+
// Here we use the graceful context because the script runner is
1135+
// not directly tied to the agent API.
1136+
//
1137+
// First we run the start scripts to ensure the workspace has
1138+
// been initialized and then the post start scripts which may
1139+
// depend on the workspace start scripts.
1140+
//
1141+
// Measure the time immediately after the start scripts have
1142+
// finished (both start and post start). For instance, an
1143+
// autostarted devcontainer will be included in this time.
11311144
err:=a.scriptRunner.Execute(a.gracefulCtx,agentscripts.ExecuteStartScripts)
11321145
err=errors.Join(err,a.scriptRunner.Execute(a.gracefulCtx,agentscripts.ExecutePostStartScripts))
1133-
// Measure the time immediately after the script has finished
11341146
dur:=time.Since(start).Seconds()
11351147
iferr!=nil {
11361148
a.logger.Warn(ctx,"startup script(s) failed",slog.Error(err))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp