feat(cmd/daemon): new flag to set clean cache interval

This commit is contained in:
2019-06-16 23:15:26 +02:00
parent 13fcb9776d
commit 64590c1194
2 changed files with 14 additions and 6 deletions

View File

@ -16,7 +16,9 @@ import (
)
// Start the daemon
func Start(cnf *config.Configuration, compression bool) error {
func Start(cnf *config.Configuration, cleanCacheIntervall time.Duration, compression bool) error {
ticker := time.Tick(cleanCacheIntervall)
interrupt := make(chan os.Signal, 1)
signal.Notify(interrupt, os.Interrupt, os.Kill, syscall.SIGTERM)
@ -30,8 +32,6 @@ func Start(cnf *config.Configuration, compression bool) error {
temperatures := make([]*types.Temperature, 0)
ticker := time.Tick(time.Second * 300)
rgbLEDs := cnf.GetRGBLEDs(config.ENABLED)
err := rgbled.Green(rgbLEDs)
if err != nil {