mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
Add option no_lock to use no lock file if none was configured
This commit is contained in:
parent
8f87273837
commit
bb053bd427
3 changed files with 13 additions and 1 deletions
|
|
@ -34,6 +34,10 @@ const (
|
|||
defaultUpdateInterval = "on best effort"
|
||||
)
|
||||
|
||||
var (
|
||||
defaultLockFile = "/var/csaf_aggregator/run.lock"
|
||||
)
|
||||
|
||||
type provider struct {
|
||||
Name string `toml:"name"`
|
||||
Domain string `toml:"domain"`
|
||||
|
|
@ -71,6 +75,7 @@ type config struct {
|
|||
|
||||
// LockFile tries to lock to a given file.
|
||||
LockFile *string `toml:"lock_file"`
|
||||
NoLock bool `toml:"no_lock"`
|
||||
|
||||
// Interim performs an interim scan.
|
||||
Interim bool `toml:"interim"`
|
||||
|
|
@ -262,6 +267,10 @@ func (c *config) setDefaults() {
|
|||
c.Domain = defaultDomain
|
||||
}
|
||||
|
||||
if !c.NoLock && c.LockFile == nil {
|
||||
c.LockFile = &defaultLockFile
|
||||
}
|
||||
|
||||
if c.Workers <= 0 {
|
||||
if n := runtime.NumCPU(); n > defaultWorkers {
|
||||
c.Workers = defaultWorkers
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue