Skip to content

Commit

Permalink
removes magic string
Browse files Browse the repository at this point in the history
  • Loading branch information
angrieralien committed Apr 28, 2023
1 parent 1a8c6ce commit ad7f152
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,16 @@ func handleAuditLogMetrics(
auditLogWriteTimeSecondThreshold int,
) {

auditLogFilePath := "/var/log/audit/audit.log"

eg.Go(func() error {
tickChan := time.NewTicker(time.Second * time.Duration(auditMetricsSecondsInterval)).C
for {
select {
case <-tickChan:
s, err := os.Stat("/var/log/audit/audit.log")
s, err := os.Stat(auditLogFilePath)
if err != nil {
return fmt.Errorf("error stat-ing /var/log/audit/audit.log")
return fmt.Errorf("error stat-ing %s", auditLogFilePath)
}

if time.Now().Sub(s.ModTime()).Seconds() > float64(auditLogWriteTimeSecondThreshold) {
Expand Down

0 comments on commit ad7f152

Please sign in to comment.