mirror of
https://github.com/crazy-max/diun.git
synced 2025-12-21 13:23:09 +01:00
Review config file structure and improve worker pool
This commit is contained in:
@@ -67,10 +67,6 @@ func main() {
|
||||
if err != nil {
|
||||
log.Fatal().Err(err).Msg("Cannot load configuration")
|
||||
}
|
||||
if err := cfg.Check(); err != nil {
|
||||
cfg.Display()
|
||||
log.Fatal().Err(err).Msg("Improper configuration")
|
||||
}
|
||||
cfg.Display()
|
||||
|
||||
// Init
|
||||
@@ -85,7 +81,7 @@ func main() {
|
||||
|
||||
// Start scheduler
|
||||
c = cron.NewWithLocation(location)
|
||||
log.Info().Msgf("Watcher initialized with schedule %s", cfg.Watch.Schedule)
|
||||
log.Info().Msgf("Cron initialized with schedule %s", cfg.Watch.Schedule)
|
||||
if err := c.AddJob(cfg.Watch.Schedule, diun); err != nil {
|
||||
log.Fatal().Err(err).Msg("Cannot create cron task")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user