File tree 1 file changed +8
-11
lines changed
internal/node/processmanager
1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -108,19 +108,16 @@ func (s *SpawningProcessManager) EnterLameDuck() error {
108
108
109
109
// Attaches a deployment request to a running process. Until a process is prepared, it's just an empty agent
110
110
func (s * SpawningProcessManager ) PrepareWorkload (workloadID string , deployRequest * agentapi.DeployRequest ) error {
111
- select {
112
- case proc := <- s .warmProcs :
113
- if proc == nil {
114
- return fmt .Errorf ("could not prepare workload, no agent process" )
115
- }
116
- proc .deployRequest = deployRequest
117
- proc .workloadStarted = time .Now ().UTC ()
118
-
119
- s .deployRequests [proc .ID ] = deployRequest
120
- case <- time .After (500 * time .Millisecond ):
121
- return fmt .Errorf ("timed out waiting for available agent process" )
111
+ proc := <- s .warmProcs
112
+ if proc == nil {
113
+ return fmt .Errorf ("could not prepare workload, no available agent process" )
122
114
}
123
115
116
+ proc .deployRequest = deployRequest
117
+ proc .workloadStarted = time .Now ().UTC ()
118
+
119
+ s .deployRequests [proc .ID ] = deployRequest
120
+
124
121
return nil
125
122
}
126
123
You can’t perform that action at this time.
0 commit comments