1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 11:55:40 +01:00

Change default location of lock file for csaf aggregator and rephrase error message if lock is in use.

This commit is contained in:
JanHoefelmeyer 2023-03-27 11:05:59 +02:00
parent c3a80b9f52
commit b0d7df69b8
4 changed files with 4 additions and 4 deletions

View file

@ -32,7 +32,7 @@ const (
defaultWeb = "/var/www/html"
defaultDomain = "https://example.com"
defaultUpdateInterval = "on best effort"
defaultLockFile = "/var/csaf_aggregator/run.lock"
defaultLockFile = "/var/lock/csaf_aggregator/lock"
)
type provider struct {

View file

@ -46,7 +46,7 @@ func lock(lockFile *string, fn func() error) error {
}
if !locked {
return fmt.Errorf("cannot lock to file %s", *lockFile)
return fmt.Errorf("cannot aquire file lock at %s. Maybe the CSAF aggregator is already running?", *lockFile)
}
defer fl.Unlock()
return fn()