decouple bouncer dependencies: use go-cs-lib/pkg/* (#2216)

* decouple bouncer dependencies: use go-cs-lib/pkg/trace
* decouple bouncer dependencies: use go-cs-lib/pkg/version
* decouple bouncer dependencies: use go-cs-lib/pkg/yamlpatch
* decouple bouncer dependencies: use go-cs-lib/pkg/csstring
* unused import
This commit is contained in:
mmetc 2023-05-23 10:52:47 +02:00 committed by GitHub
parent eddb994c0b
commit 534328ca30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
59 changed files with 191 additions and 1297 deletions

View file

@ -8,6 +8,8 @@ import (
"sync"
"time"
"github.com/crowdsecurity/go-cs-lib/pkg/trace"
"github.com/crowdsecurity/crowdsec/pkg/apiclient"
"github.com/crowdsecurity/crowdsec/pkg/csconfig"
"github.com/crowdsecurity/crowdsec/pkg/database"
@ -217,8 +219,7 @@ func (p *Papi) PullOnce(since time.Time, sync bool) error {
// PullPAPI is the long polling client for real-time decisions from PAPI
func (p *Papi) Pull() error {
defer types.CatchPanic("lapi/PullPAPI")
defer trace.CatchPanic("lapi/PullPAPI")
p.Logger.Infof("Starting Polling API Pull")
lastTimestamp := time.Time{}
@ -270,7 +271,7 @@ func (p *Papi) Pull() error {
}
func (p *Papi) SyncDecisions() error {
defer types.CatchPanic("lapi/syncDecisionsToCAPI")
defer trace.CatchPanic("lapi/syncDecisionsToCAPI")
var cache models.DecisionsDeleteRequest
ticker := time.NewTicker(p.SyncInterval)