Skip to content

Commit

Permalink
WaitForClock: give up after 1 year, not 1 minute
Browse files Browse the repository at this point in the history
related to issue #21
  • Loading branch information
stapelberg committed Mar 25, 2017
1 parent 83181ca commit 3999a60
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gokrazy.go
Expand Up @@ -138,12 +138,12 @@ func Supervise(commands []*exec.Cmd) error {
// set. Assumes that the system boots with a clock value of January 1,
// 1970 UTC (UNIX epoch), as is the case on the Raspberry Pi 3.
func WaitForClock() {
epochPlus1Minute := time.Unix(60, 0)
epochPlus1Year := time.Unix(60*60*24*365, 0)
for {
if time.Now().After(epochPlus1Minute) {
if time.Now().After(epochPlus1Year) {
return
}
// Sleeps for 1 real minute, regardless of wall-clock time.
// Sleeps for 1 real second, regardless of wall-clock time.
// See https://github.com/golang/proposal/blob/master/design/12914-monotonic.md
time.Sleep(1 * time.Second)
}
Expand Down

0 comments on commit 3999a60

Please sign in to comment.