Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions pkg/cortex/cortex.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,18 +221,13 @@ func (t *Cortex) Run() error {

// Stop gracefully stops a Cortex.
func (t *Cortex) Stop() error {
t.server.Shutdown()
t.stop(t.target)
return nil
}

func (t *Cortex) stop(m moduleName) {
t.stopModule(m)
deps := orderedDeps(m)
t.stopModule(t.target)
deps := orderedDeps(t.target)
// iterate over our deps in reverse order and call stopModule
for i := len(deps) - 1; i >= 0; i-- {
t.stopModule(deps[i])
}
return nil
}

func (t *Cortex) stopModule(m moduleName) {
Expand Down