Skip to content

Commit

Permalink
removing counter
Browse files Browse the repository at this point in the history
Signed-off-by: Jaydip Gabani <[email protected]>
  • Loading branch information
JaydipGabani committed Nov 22, 2024
1 parent 469f207 commit 1d73638
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions pkg/pubsub/diskwriter/diskwriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ const (
Name = "diskwriter"
)

var count int

func (r *DiskWriter) Publish(_ context.Context, data interface{}, _ string) error {
if msg, ok := data.(string); ok && msg == "audit is completed" {
// release lock
Expand Down Expand Up @@ -57,14 +55,10 @@ func (r *DiskWriter) Publish(_ context.Context, data interface{}, _ string) erro
r.file = file
}

_, err = r.file.WriteString(fmt.Sprint("Violation number: ", count, " ") + string(jsonData) + "\n")
_, err = r.file.WriteString(string(jsonData) + "\n")
if err != nil {
return fmt.Errorf("error publishing message to dapr: %w", err)
}

log.Printf("%d messages published", count)

count++

return nil
}
Expand Down

0 comments on commit 1d73638

Please sign in to comment.