From 7ce74576e148e3f1b5fe4249a5c8353070dcf2fc Mon Sep 17 00:00:00 2001 From: PJ Date: Tue, 27 Aug 2024 15:23:01 +0200 Subject: [PATCH] contractor: remove shutdown ctx --- autopilot/contractor/contractor.go | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/autopilot/contractor/contractor.go b/autopilot/contractor/contractor.go index 4e1b87d3b..d384c88f3 100644 --- a/autopilot/contractor/contractor.go +++ b/autopilot/contractor/contractor.go @@ -132,9 +132,6 @@ type ( revisionSubmissionBuffer uint64 firstRefreshFailure map[types.FileContractID]time.Time - - shutdownCtx context.Context - shutdownCtxCancel context.CancelFunc } scoredHost struct { @@ -167,7 +164,6 @@ type ( func New(bus Bus, alerter alerts.Alerter, logger *zap.SugaredLogger, revisionSubmissionBuffer uint64, revisionBroadcastInterval time.Duration) *Contractor { logger = logger.Named("contractor") - ctx, cancel := context.WithCancel(context.Background()) return &Contractor{ bus: bus, alerter: alerter, @@ -179,17 +175,9 @@ func New(bus Bus, alerter alerts.Alerter, logger *zap.SugaredLogger, revisionSub revisionSubmissionBuffer: revisionSubmissionBuffer, firstRefreshFailure: make(map[types.FileContractID]time.Time), - - shutdownCtx: ctx, - shutdownCtxCancel: cancel, } } -func (c *Contractor) Close() error { - c.shutdownCtxCancel() - return nil -} - func (c *Contractor) PerformContractMaintenance(ctx context.Context, w Worker, state *MaintenanceState) (bool, error) { return performContractMaintenance(newMaintenanceCtx(ctx, state), c.alerter, c.bus, c.churn, w, c, c, c, c.logger) }