Browse Source

change allowed hour to minutes

master
Angga Bayu Marthafifsa 6 years ago
parent
commit
de5fd36d8f
  1. 6
      parser/devicePrsInternal.go

6
parser/devicePrsInternal.go

@ -19,7 +19,7 @@ import (
) )
const ( const (
ALLOWED_TIME_HOUR = -1 ALLOWED_TIME_MINUTES = -5
) )
type ruptelaTchHeader struct { type ruptelaTchHeader struct {
@ -327,8 +327,8 @@ func parseData(data []byte, imei uint64, tagOption *opt.Options) (rec DeviceReco
deviceRecord.TagDevices = tags_ deviceRecord.TagDevices = tags_
tstampToNow := time.Since(deviceRecord.Tstamp) tstampToNow := time.Since(deviceRecord.Tstamp)
hCurr := math.Round(tstampToNow.Hours()*100)/100 hCurr := math.Round(tstampToNow.Minutes()*100)/100
if hCurr >= ALLOWED_TIME_HOUR { if hCurr >= ALLOWED_TIME_MINUTES {
deviceRecords = append(deviceRecords, deviceRecord) deviceRecords = append(deviceRecords, deviceRecord)
} }

Loading…
Cancel
Save