1
0
forked from ALHP/ALHP.GO

added cli option for check interval

This commit is contained in:
2021-09-12 17:35:45 +02:00
parent 7bfa9abeb7
commit 1cf45cedb0

23
main.go
View File

@@ -29,16 +29,17 @@ import (
) )
var ( var (
conf = Conf{} conf = Conf{}
repos []string repos []string
alpmHandle *alpm.Handle alpmHandle *alpm.Handle
reMarch = regexp.MustCompile(`(-march=)(.+?) `) reMarch = regexp.MustCompile(`(-march=)(.+?) `)
rePkgRel = regexp.MustCompile(`(?m)^pkgrel\s*=\s*(.+)$`) rePkgRel = regexp.MustCompile(`(?m)^pkgrel\s*=\s*(.+)$`)
rePkgFile = regexp.MustCompile(`^(.*)-.*-.*-(?:x86_64|any)\.pkg\.tar\.zst(?:\.sig)*$`) rePkgFile = regexp.MustCompile(`^(.*)-.*-.*-(?:x86_64|any)\.pkg\.tar\.zst(?:\.sig)*$`)
buildManager BuildManager buildManager BuildManager
db *ent.Client db *ent.Client
dbLock sync.RWMutex dbLock sync.RWMutex
journalLog = flag.Bool("journal", false, "Log to systemd journal instead of stdout") journalLog = flag.Bool("journal", false, "Log to systemd journal instead of stdout")
checkInterval = flag.Int("interval", 5, "How often svn2git should be checked in minutes (default: 5)")
) )
func (b *BuildManager) buildWorker(id int) { func (b *BuildManager) buildWorker(id int) {
@@ -590,7 +591,7 @@ func (b *BuildManager) syncWorker() {
} }
b.parseWG.Wait() b.parseWG.Wait()
time.Sleep(5 * time.Minute) time.Sleep(time.Duration(*checkInterval) * time.Minute)
} }
} }