MCPcopy
hub / github.com/grafana/tempo / Remove

Function Remove

pkg/util/shutdownmarker/shutdown_marker.go:28–43  ·  view source on GitHub ↗

Remove removes the shutdown marker file on the given path if it exists.

(p string)

Source from the content-addressed store, hash-verified

26
27// Remove removes the shutdown marker file on the given path if it exists.
28func Remove(p string) error {
29 err := os.Remove(p)
30 if err != nil && !os.IsNotExist(err) {
31 return err
32 }
33
34 dir, err := os.OpenFile(path.Dir(p), os.O_RDONLY, 0o600) // mode doesn't matter since we're not passing os.O_CREATE
35 if err != nil {
36 return err
37 }
38
39 merr := multierror.New()
40 merr.Add(dir.Sync())
41 merr.Add(dir.Close())
42 return merr.Err()
43}
44
45// Exists returns true if the shutdown marker file exists on the given path, false otherwise
46func Exists(p string) (bool, error) {

Callers 2

stoppingMethod · 0.92

Calls 3

RemoveMethod · 0.80
AddMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected