Skip to content

Commit 2174585

Browse files
committed
in_kubernetes_events: fix sqldb cleanup
Signed-off-by: Christian Rudolph <[email protected]>
1 parent 4c4f8c0 commit 2174585

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: plugins/in_kubernetes_events/kubernetes_events.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -649,13 +649,12 @@ static int k8s_events_cleanup_db(struct flb_input_instance *ins,
649649
int ret;
650650
struct k8s_events *ctx = (struct k8s_events *)in_context;
651651
time_t retention_time_ago;
652-
time_t now = (cfl_time_now() / 1000000000);
653652

654653
if (ctx->db == NULL) {
655654
FLB_INPUT_RETURN(0);
656655
}
657656

658-
retention_time_ago = now - (ctx->retention_time);
657+
retention_time_ago = cfl_time_now() - (ctx->retention_time * 1000000000L);
659658
sqlite3_bind_int64(ctx->stmt_delete_old_kubernetes_events,
660659
1, (int64_t)retention_time_ago);
661660
ret = sqlite3_step(ctx->stmt_delete_old_kubernetes_events);

0 commit comments

Comments
 (0)