github.com/caos/orbos@v1.5.14-0.20221103111702-e6cd0cea7ad4/internal/ctrlgitops/common.go (about)

     1  package ctrlgitops
     2  
     3  import (
     4  	"context"
     5  	"time"
     6  
     7  	"github.com/caos/orbos/mntr"
     8  	"github.com/caos/orbos/pkg/git"
     9  )
    10  
    11  func gitClient(monitor mntr.Monitor, task string) *git.Client {
    12  	return git.New(context.Background(), monitor.WithField("task", task), "Boom", "boom@caos.ch")
    13  }
    14  
    15  func checks(monitor mntr.Monitor, client *git.Client) {
    16  	defer func() { monitor.RecoverPanic(recover()) }()
    17  	t := time.NewTicker(13 * time.Hour)
    18  	for range t.C {
    19  		if err := client.Check(); err != nil {
    20  			monitor.Error(err)
    21  		}
    22  	}
    23  }