File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -1213,9 +1213,12 @@ func (a *agent) Close() error {
1213
1213
1214
1214
// Close services before running shutdown script.
1215
1215
// TODO(mafredri): Gracefully shutdown:
1216
+ // - Cancel startup script, if running
1216
1217
// - Close active SSH server connections
1217
1218
// - Close processes (send HUP, wait, etc.)
1218
1219
1220
+ // TODO(mafredri): Only run shutdown script if the agent is 'ready'?
1221
+
1219
1222
lifecycleState := codersdk .WorkspaceAgentLifecycleOff
1220
1223
if metadata , ok := a .metadata .Load ().(agentsdk.Metadata ); ok {
1221
1224
scriptDone := make (chan error , 1 )
@@ -1254,6 +1257,7 @@ func (a *agent) Close() error {
1254
1257
// Set final state and wait for it to be reported because context
1255
1258
// cancellation will stop the report loop.
1256
1259
a .setLifecycle (ctx , lifecycleState )
1260
+ // TODO(mafredri): What if the agent token is revoked, build outdated, etc.?
1257
1261
for s := range a .lifecycleReported {
1258
1262
if s == lifecycleState {
1259
1263
break
You can’t perform that action at this time.
0 commit comments