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

Loading…
Cancel
Save