@@ -1318,14 +1318,6 @@ func (a *agent) Close() error {
1318
1318
ctx := context .Background ()
1319
1319
a .setLifecycle (ctx , codersdk .WorkspaceAgentLifecycleShuttingDown )
1320
1320
1321
- // Close services before running shutdown script.
1322
- // TODO(mafredri): Gracefully shutdown:
1323
- // - Cancel startup script, if running
1324
- // - Close active SSH server connections
1325
- // - Close processes (send HUP, wait, etc.)
1326
-
1327
- // TODO(mafredri): Only run shutdown script if the agent is 'ready'?
1328
-
1329
1321
lifecycleState := codersdk .WorkspaceAgentLifecycleOff
1330
1322
if metadata , ok := a .metadata .Load ().(agentsdk.Metadata ); ok && metadata .ShutdownScript != "" {
1331
1323
scriptDone := make (chan error , 1 )
@@ -1365,11 +1357,6 @@ func (a *agent) Close() error {
1365
1357
// cancellation will stop the report loop.
1366
1358
a .setLifecycle (ctx , lifecycleState )
1367
1359
1368
- if lifecycleState != codersdk .WorkspaceAgentLifecycleOff {
1369
- // TODO(mafredri): Delay shutdown, ensure debugging is possible.
1370
- _ = false
1371
- }
1372
-
1373
1360
// Wait for the lifecycle to be reported, but don't wait forever so
1374
1361
// that we don't break user expectations.
1375
1362
ctx , cancel := context .WithTimeout (ctx , 5 * time .Second )
0 commit comments