Skip to content

Commit

Permalink
fix sca (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
xzxiong authored Jun 11, 2024
1 parent 6621030 commit 764eaa6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/util/metric/mometric/cron_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ func CalculateStorageUsage(ctx context.Context, sqlExecutor func() ie.InternalEx
defer span.End()
ctx = defines.AttachAccount(ctx, catalog.System_Account, catalog.System_User, catalog.System_Role)
ctx, cancel := context.WithCancel(ctx)
defer cancel() // quit CheckNewAccountSize goroutine
logger := runtime.ProcessLevelRuntime().Logger().WithContext(ctx).Named(LoggerNameMetricStorage)
logger.Info("started")
if !checkServerStarted(logger) {
Expand All @@ -131,8 +132,6 @@ func CalculateStorageUsage(ctx context.Context, sqlExecutor func() ie.InternalEx
defer func() {
logger.Info("finished", zap.Error(err))
cleanStorageUsageMetric(logger, "CalculateStorageUsage")
// quit CheckNewAccountSize goroutine
cancel()
}()

// start background task to check new account
Expand Down

0 comments on commit 764eaa6

Please sign in to comment.