mirror of
https://github.com/anchore/syft
synced 2024-11-10 06:14:16 +00:00
fix: add log time of task (#3105)
Signed-off-by: tomersein <tomersein@gmail.com>
This commit is contained in:
parent
5ab43bafec
commit
04e3371cce
1 changed files with 6 additions and 1 deletions
|
@ -5,7 +5,9 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
"sync"
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/anchore/syft/internal/log"
|
||||||
"github.com/hashicorp/go-multierror"
|
"github.com/hashicorp/go-multierror"
|
||||||
|
|
||||||
"github.com/anchore/syft/internal/sbomsync"
|
"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…
Reference in a new issue