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 @@ -1223,9 +1223,12 @@ func (a *agent) Close() error {
1223
1223
1224
1224
// Close services before running shutdown script.
1225
1225
// TODO(mafredri): Gracefully shutdown:
1226
+ // - Cancel startup script, if running
1226
1227
// - Close active SSH server connections
1227
1228
// - Close processes (send HUP, wait, etc.)
1228
1229
1230
+ // TODO(mafredri): Only run shutdown script if the agent is 'ready'?
1231
+
1229
1232
lifecycleState := codersdk .WorkspaceAgentLifecycleOff
1230
1233
if metadata , ok := a .metadata .Load ().(agentsdk.Metadata ); ok {
1231
1234
scriptDone := make (chan error , 1 )
@@ -1264,6 +1267,7 @@ func (a *agent) Close() error {
1264
1267
// Set final state and wait for it to be reported because context
1265
1268
// cancellation will stop the report loop.
1266
1269
a .setLifecycle (ctx , lifecycleState )
1270
+ // TODO(mafredri): What if the agent token is revoked, build outdated, etc.?
1267
1271
for s := range a .lifecycleReported {
1268
1272
if s == lifecycleState {
1269
1273
break
You can’t perform that action at this time.
0 commit comments