Skip to content

Commit

Permalink
Merge pull request #103 from ddosify/feat/resync-k8s
Browse files Browse the repository at this point in the history
resync k8s resources periodically
  • Loading branch information
fatihbaltaci authored Mar 7, 2024
2 parents 1941d62 + 5dbc0be commit 94a26c7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion k8s/informer.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"os"
"path/filepath"
"sync"
"time"

"github.com/ddosify/alaz/log"

Expand Down Expand Up @@ -42,6 +43,7 @@ const (
)

var k8sVersion string
var resynPeriod time.Duration = 60 * time.Second

type K8sCollector struct {
ctx context.Context
Expand Down Expand Up @@ -187,7 +189,7 @@ func NewK8sCollector(parentCtx context.Context) (*K8sCollector, error) {

k8sVersion = version.String()

factory := informers.NewSharedInformerFactory(clientset, 0)
factory := informers.NewSharedInformerFactory(clientset, resynPeriod)

collector := &K8sCollector{
ctx: ctx,
Expand Down

0 comments on commit 94a26c7

Please sign in to comment.