Skip to content

Commit

Permalink
fix_utc
Browse files Browse the repository at this point in the history
  • Loading branch information
gsanchietti committed Aug 22, 2024
1 parent 7a75935 commit a271575
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/methods/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a271575

Please sign in to comment.