mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-22 00:27:44 +01:00
commit
28ee5f7d43
@ -18,6 +18,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math"
|
"math"
|
||||||
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"errors"
|
"errors"
|
||||||
@ -45,6 +46,8 @@ type Context struct {
|
|||||||
cfgMgr comcfg.CfgManager
|
cfgMgr comcfg.CfgManager
|
||||||
// job life cycle tracker
|
// job life cycle tracker
|
||||||
tracker job.Tracker
|
tracker job.Tracker
|
||||||
|
// job logger configs settings map lock
|
||||||
|
lock sync.Mutex
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewContext ...
|
// NewContext ...
|
||||||
@ -123,6 +126,8 @@ func (c *Context) Build(tracker job.Tracker) (job.Context, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set loggers for job
|
// Set loggers for job
|
||||||
|
c.lock.Lock()
|
||||||
|
defer c.lock.Unlock()
|
||||||
lg, err := createLoggers(tracker.Job().Info.JobID)
|
lg, err := createLoggers(tracker.Job().Info.JobID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user