🐛 Use interval from config instead of hardcoded value
All checks were successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful

This commit is contained in:
Ada 2024-05-22 01:58:15 +02:00
parent d01f3c8cdf
commit 5280ae3533
Signed by: ada
GPG key ID: 6A7F898157C6DE6E
2 changed files with 3 additions and 2 deletions

View file

@ -4,7 +4,7 @@ File format used is https://toml.io/en/[toml]. You can specify config file in fi
== Options:
* `clonedirectory`: Directory where mirror is clone
* `interval`: Update interval
* `interval`: Update interval in minute
* `log`: Log config section
** `level`: Log level, allowed value is: "DEBUG", "INFO", "WARN", "ERROR", "FATAL"
** `file`: Log file, default (empty) is in stderr

View file

@ -40,7 +40,8 @@ func main() {
git.StartClone(initConfig.RepoList)
cron.Launch(time.Minute, initConfig.RepoList)
duration := time.Duration(initConfig.Interval) * time.Minute
cron.Launch(duration, initConfig.RepoList)
quitSignal := make(chan os.Signal, 1)
signal.Notify(quitSignal, syscall.SIGINT, syscall.SIGTERM)