@@ -57,29 +57,29 @@ func HandleSignals(ctx context.Context) error {
5757 return nil
5858}
5959
60- func deleteDecisions (custom * custom.CustomBouncer , decisions []* models.Decision ) {
60+ func deleteDecisions (ctx context. Context , custom * custom.CustomBouncer , decisions []* models.Decision ) {
6161 if len (decisions ) == 1 {
62- log .Infof ("deleting 1 decision" )
62+ log .Info ("deleting 1 decision" )
6363 } else {
6464 log .Infof ("deleting %d decisions" , len (decisions ))
6565 }
6666 for _ , d := range decisions {
67- if err := custom .Delete (d ); err != nil {
67+ if err := custom .Delete (ctx , d ); err != nil {
6868 log .Errorf ("unable to delete decision for '%s': %s" , * d .Value , err )
6969 continue
7070 }
7171 log .Debugf ("deleted '%s'" , * d .Value )
7272 }
7373}
7474
75- func addDecisions (custom * custom.CustomBouncer , decisions []* models.Decision ) {
75+ func addDecisions (ctx context. Context , custom * custom.CustomBouncer , decisions []* models.Decision ) {
7676 if len (decisions ) == 1 {
7777 log .Info ("adding 1 decision" )
7878 } else {
7979 log .Infof ("adding %d decisions" , len (decisions ))
8080 }
8181 for _ , d := range decisions {
82- if err := custom .Add (d ); err != nil {
82+ if err := custom .Add (ctx , d ); err != nil {
8383 log .Errorf ("unable to insert decision for '%s': %s" , * d .Value , err )
8484 continue
8585 }
@@ -236,13 +236,13 @@ func Execute() error {
236236 }
237237
238238 g .Go (func () error {
239- log .Infof ("Processing new and deleted decisions . . ." )
239+ log .Info ("Processing new and deleted decisions . . ." )
240240 for {
241241 select {
242242 case <- ctx .Done ():
243- log .Infoln ("terminating bouncer process" )
243+ log .Info ("terminating bouncer process" )
244244 if config .PrometheusConfig .Enabled {
245- log .Infoln ("terminating prometheus server" )
245+ log .Info ("terminating prometheus server" )
246246 if err := promServer .Shutdown (context .Background ()); err != nil {
247247 log .Errorf ("unable to shutdown prometheus server: %s" , err )
248248 }
@@ -252,8 +252,8 @@ func Execute() error {
252252 if decisions == nil {
253253 continue
254254 }
255- deleteDecisions (custom , decisions .Deleted )
256- addDecisions (custom , decisions .New )
255+ deleteDecisions (ctx , custom , decisions .Deleted )
256+ addDecisions (ctx , custom , decisions .New )
257257 case <- cacheResetTicker .C :
258258 custom .ResetCache ()
259259 }
0 commit comments