@@ -1223,14 +1223,6 @@ func (a *agent) Close() error {
1223
1223
ctx := context .Background ()
1224
1224
a .setLifecycle (ctx , codersdk .WorkspaceAgentLifecycleShuttingDown )
1225
1225
1226
- // Close services before running shutdown script.
1227
- // TODO(mafredri): Gracefully shutdown:
1228
- // - Cancel startup script, if running
1229
- // - Close active SSH server connections
1230
- // - Close processes (send HUP, wait, etc.)
1231
-
1232
- // TODO(mafredri): Only run shutdown script if the agent is 'ready'?
1233
-
1234
1226
lifecycleState := codersdk .WorkspaceAgentLifecycleOff
1235
1227
if metadata , ok := a .metadata .Load ().(agentsdk.Metadata ); ok && metadata .ShutdownScript != "" {
1236
1228
scriptDone := make (chan error , 1 )
@@ -1270,11 +1262,6 @@ func (a *agent) Close() error {
1270
1262
// cancellation will stop the report loop.
1271
1263
a .setLifecycle (ctx , lifecycleState )
1272
1264
1273
- if lifecycleState != codersdk .WorkspaceAgentLifecycleOff {
1274
- // TODO(mafredri): Delay shutdown, ensure debugging is possible.
1275
- _ = false
1276
- }
1277
-
1278
1265
// Wait for the lifecycle to be reported, but don't wait forever so
1279
1266
// that we don't break user expectations.
1280
1267
ctx , cancel := context .WithTimeout (ctx , 5 * time .Second )
0 commit comments