mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Annotations: don't log context.Cancelled as an error when cleaning up (#39024)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
This commit is contained in:
parent
b56bf83c19
commit
d19f33b52f
@ -2,6 +2,7 @@ package cleanup
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
@ -67,7 +68,7 @@ func (srv *CleanUpService) Run(ctx context.Context) error {
|
|||||||
func (srv *CleanUpService) cleanUpOldAnnotations(ctx context.Context) {
|
func (srv *CleanUpService) cleanUpOldAnnotations(ctx context.Context) {
|
||||||
cleaner := annotations.GetAnnotationCleaner()
|
cleaner := annotations.GetAnnotationCleaner()
|
||||||
affected, affectedTags, err := cleaner.CleanAnnotations(ctx, srv.Cfg)
|
affected, affectedTags, err := cleaner.CleanAnnotations(ctx, srv.Cfg)
|
||||||
if err != nil {
|
if err != nil && !errors.Is(err, context.DeadlineExceeded) {
|
||||||
srv.log.Error("failed to clean up old annotations", "error", err)
|
srv.log.Error("failed to clean up old annotations", "error", err)
|
||||||
} else {
|
} else {
|
||||||
srv.log.Debug("Deleted excess annotations", "annotations affected", affected, "annotation tags affected", affectedTags)
|
srv.log.Debug("Deleted excess annotations", "annotations affected", affected, "annotation tags affected", affectedTags)
|
||||||
|
Loading…
Reference in New Issue
Block a user