Skip to content
This repository was archived by the owner on Jul 28, 2020. It is now read-only.

Commit bd5b555

Browse files
committed
Stop using *pointer in analyticsd daemon to avoid random panics
http://ci.pcfdev.io/teams/main/pipelines/cfdev/jobs/build/builds/501#L5b96c882:14:59
1 parent b4ad386 commit bd5b555

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

analyticsd/daemon/daemon.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type Daemon struct {
2828
ticker *time.Ticker
2929
pollingInterval time.Duration
3030
logger *log.Logger
31-
lastTime *time.Time
31+
lastTime time.Time
3232
doneChan chan bool
3333
}
3434

@@ -257,7 +257,7 @@ func eventTypesFilter() string {
257257

258258
func (d *Daemon) saveLatestTime(t time.Time) {
259259
t = t.UTC()
260-
if d.lastTime == nil || t.After(*d.lastTime) {
261-
d.lastTime = &t
260+
if t.After(d.lastTime) {
261+
d.lastTime = t
262262
}
263263
}

0 commit comments

Comments
 (0)