Infinite busy waiting for lost event (#31)
* Close evaluation stream for Nomad Job creation when set event handler have been finished * Remove evaluation event stream requests by handling the events via the main Nomad event handler.
This commit is contained in:
@@ -177,7 +177,9 @@ func (n *NomadEnvironment) Register(apiClient nomad.ExecutorAPI) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("couldn't register job: %w", err)
|
||||
}
|
||||
err = apiClient.MonitorEvaluation(evalID, context.Background())
|
||||
ctx, cancel := context.WithTimeout(context.Background(), nomad.RegisterTimeout)
|
||||
defer cancel()
|
||||
err = apiClient.MonitorEvaluation(evalID, ctx)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error during the monitoring of the environment job: %w", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user