We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
container logs
1 parent 0384967 commit a6893f3Copy full SHA for a6893f3
cmd/icinga-kubernetes/main.go
@@ -198,6 +198,26 @@ func main() {
198
return
199
}
200
}, periodic.Immediate()).Stop()
201
+
202
+ defer periodic.Start(ctx, time.Hour, func(tick periodic.Tick) {
203
+ olderThan := tick.Time.AddDate(0, 0, -1)
204
205
+ _, err := db.CleanupOlderThan(
206
+ ctx, database.CleanupStmt{
207
+ Table: "container_log",
208
+ PK: "container_id, pod_id, period",
209
+ Column: "last_update",
210
+ }, 5000, olderThan,
211
+ )
212
+ if err != nil {
213
+ select {
214
+ case errs <- err:
215
+ case <-ctx.Done():
216
+ }
217
218
+ return
219
220
+ }, periodic.Immediate()).Stop()
221
com.ErrgroupReceive(ctx, g, errs)
222
223
if err := g.Wait(); err != nil {
0 commit comments