mirror of
https://github.com/MeshCore-Beacon/beacon-server.git
synced 2026-09-01 16:48:19 +00:00
fix(ingest): add more possible heard at timestamp formats
This commit is contained in:
@@ -706,9 +706,15 @@ func (w *Worker) handlePacket(ctx context.Context, iata, pubkeyHex string, raw [
|
||||
if err != nil {
|
||||
heardAt, err = time.Parse("2006-01-02T15:04:05.000000", envelope.Timestamp)
|
||||
}
|
||||
if err != nil {
|
||||
heardAt, err = time.Parse("2006-01-02T15:04:05.000000Z", envelope.Timestamp)
|
||||
}
|
||||
if err != nil {
|
||||
heardAt, err = time.Parse("2006-01-02T15:04:05", envelope.Timestamp)
|
||||
}
|
||||
if err != nil {
|
||||
heardAt, err = time.Parse("2006-01-02T15:04:05Z", envelope.Timestamp)
|
||||
}
|
||||
if err != nil {
|
||||
log.Printf("ingest[%s]: failed to parse timestamp %q: %v", w.cfg.BrokerName, envelope.Timestamp, err)
|
||||
heardAt = time.Now().UTC()
|
||||
|
||||
Reference in New Issue
Block a user