Skip to content

Commit

Permalink
Making sure that zerolog is flushed before end of program
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Drobena committed Aug 12, 2024
1 parent 602791a commit 23b01db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion differ/differ.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import (
"github.com/RedHatInsights/ccx-notification-service/producer"
"github.com/RedHatInsights/ccx-notification-service/types"
"github.com/RedHatInsights/insights-operator-utils/evaluator"
"github.com/RedHatInsights/insights-operator-utils/logger"
)

// Exit codes
Expand Down Expand Up @@ -1000,6 +1001,9 @@ func (d *Differ) SetupFiltersAndThresholds(config *conf.ConfigStruct) error {

// Run function is entry point to the differ
func Run(config conf.ConfigStruct, cliFlags types.CliFlags) int {

defer logger.CloseZerolog()

if cliFlags.InstantReports {
notificationType = types.InstantNotif
}
Expand Down Expand Up @@ -1036,7 +1040,6 @@ func Run(config conf.ConfigStruct, cliFlags types.CliFlags) int {
}

err = d.start(&config)

return selectError(err)
}

Expand Down

0 comments on commit 23b01db

Please sign in to comment.