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 @@ -1318,9 +1318,12 @@ func (a *agent) Close() error {
1318
1318
1319
1319
// Close services before running shutdown script.
1320
1320
// TODO(mafredri): Gracefully shutdown:
1321
+ // - Cancel startup script, if running
1321
1322
// - Close active SSH server connections
1322
1323
// - Close processes (send HUP, wait, etc.)
1323
1324
1325
+ // TODO(mafredri): Only run shutdown script if the agent is 'ready'?
1326
+
1324
1327
lifecycleState := codersdk .WorkspaceAgentLifecycleOff
1325
1328
if metadata , ok := a .metadata .Load ().(agentsdk.Metadata ); ok {
1326
1329
scriptDone := make (chan error , 1 )
@@ -1359,6 +1362,7 @@ func (a *agent) Close() error {
1359
1362
// Set final state and wait for it to be reported because context
1360
1363
// cancellation will stop the report loop.
1361
1364
a .setLifecycle (ctx , lifecycleState )
1365
+ // TODO(mafredri): What if the agent token is revoked, build outdated, etc.?
1362
1366
for s := range a .lifecycleReported {
1363
1367
if s == lifecycleState {
1364
1368
break
You can’t perform that action at this time.
0 commit comments