From a271575a29a906b59bc5c20d803df8ed7250439c Mon Sep 17 00:00:00 2001 From: Giacomo Sanchietti Date: Thu, 22 Aug 2024 14:51:14 +0200 Subject: [PATCH] fix_utc --- api/methods/report.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/methods/report.go b/api/methods/report.go index c359a84..a52681a 100644 --- a/api/methods/report.go +++ b/api/methods/report.go @@ -296,6 +296,8 @@ func UpdateDpiStats(c *gin.Context) { logs.Logs.Println("[WARN][DPISTATS] skipping invalid object") continue } + logs.Logs.Println("Received timestamp: ", dpi.Timestamp) + logs.Logs.Println("Converted timestamp: ", time.Unix(dpi.Timestamp, 0)) batch.Queue("INSERT INTO dpi_stats (time, unit_id, client_address, client_name, protocol, host, application, bytes) VALUES ($1, $2, $3, $4, $5, $6, $7, $8) ON CONFLICT (time, unit_id, client_address, protocol, host, application) DO UPDATE SET bytes = EXCLUDED.bytes", time.Unix(dpi.Timestamp, 0), unit_id, dpi.ClientAddress, dpi.ClientName, dpi.Protocol, dpi.Host, dpi.Application, dpi.Bytes) } if batch.Len() != 0 {