Refactor NewAbstractManager

to require a context used for the monitoring.
This commit is contained in:
Maximilian Paß
2023-09-04 11:44:36 +02:00
parent b28b87d56f
commit 0d6b4f660c
7 changed files with 34 additions and 17 deletions

View File

@ -32,7 +32,7 @@ type NomadRunnerManager struct {
// It uses the apiClient for all requests and runs a background task to keep the runners in sync with Nomad.
// If you cancel the context the background synchronization will be stopped.
func NewNomadRunnerManager(apiClient nomad.ExecutorAPI, ctx context.Context) *NomadRunnerManager {
m := &NomadRunnerManager{NewAbstractManager(), apiClient}
m := &NomadRunnerManager{NewAbstractManager(ctx), apiClient}
go m.keepRunnersSynced(ctx)
return m
}