Skip to content

Commit

Permalink
logsearchapi - if disk capacity is 0, disable vacuuming (#894)
Browse files Browse the repository at this point in the history
  • Loading branch information
donatello authored Nov 5, 2021
1 parent 299080a commit b3fe304
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion logsearchapi/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,13 @@ func NewLogSearch(pgConnStr, auditAuthToken string, queryAuthToken string, diskC
ls.HandleFunc("/api/query", authorize(ls.queryHandler, ls.QueryAuthToken))

// Start vacuum thread
go ls.DBClient.vacuumData(ls.DiskCapacityGBs)
if ls.DiskCapacityGBs <= 0 {
// Treat disk as unlimited!
log.Printf("Disk Capacity is set to 0 or negative - older data will not be automatically removed.")
} else {
go ls.DBClient.vacuumData(ls.DiskCapacityGBs)
}

go ls.DBClient.partitionTables()

return ls, nil
Expand Down

0 comments on commit b3fe304

Please sign in to comment.