mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 08:23:15 +01:00
fix: add log time of task (#3105)
Signed-off-by: tomersein <tomersein@gmail.com>
This commit is contained in:
parent
5ab43bafec
commit
04e3371cce
@ -5,7 +5,9 @@ import (
|
||||
"fmt"
|
||||
"runtime/debug"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/anchore/syft/internal/log"
|
||||
"github.com/hashicorp/go-multierror"
|
||||
|
||||
"github.com/anchore/syft/internal/sbomsync"
|
||||
@ -68,5 +70,8 @@ func runTaskSafely(ctx context.Context, t Task, resolver file.Resolver, s sbomsy
|
||||
}
|
||||
}()
|
||||
|
||||
return t.Execute(ctx, resolver, s)
|
||||
start := time.Now()
|
||||
res := t.Execute(ctx, resolver, s)
|
||||
log.WithFields("task", t.Name(), "elapsed", time.Since(start)).Info("task completed")
|
||||
return res
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user