Skip to content

Commit

Permalink
fix_utc2
Browse files Browse the repository at this point in the history
  • Loading branch information
gsanchietti committed Aug 22, 2024
1 parent 38ec993 commit 7a75935
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/methods/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ func UpdateDpiStats(c *gin.Context) {
logs.Logs.Println("[WARN][DPISTATS] skipping invalid object")
continue
}
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).UTC(), unit_id, dpi.ClientAddress, dpi.ClientName, dpi.Protocol, dpi.Host, dpi.Application, dpi.Bytes)
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 {
err := dbpool.SendBatch(dbctx, batch).Close()
Expand Down

0 comments on commit 7a75935

Please sign in to comment.