MCPcopy Index your code
hub / github.com/cortexproject/cortex / cleanup

Method cleanup

pkg/ruler/mapper.go:45–57  ·  view source on GitHub ↗

cleanup removes all of the user directories in the path of the mapper

()

Source from the content-addressed store, hash-verified

43
44// cleanup removes all of the user directories in the path of the mapper
45func (m *mapper) cleanup() {
46 level.Info(m.logger).Log("msg", "cleaning up mapped rules directory", "path", m.Path)
47
48 users, err := m.users()
49 if err != nil {
50 level.Error(m.logger).Log("msg", "unable to read rules directory", "path", m.Path, "err", err)
51 return
52 }
53
54 for _, u := range users {
55 m.cleanupUser(u)
56 }
57}
58
59func (m *mapper) users() ([]string, error) {
60 var result []string

Callers 3

newMapperFunction · 0.95
TestUserExternalLabelsFunction · 0.45
StopMethod · 0.45

Calls 4

usersMethod · 0.95
cleanupUserMethod · 0.95
LogMethod · 0.45
ErrorMethod · 0.45

Tested by 1

TestUserExternalLabelsFunction · 0.36