Prevent server time from going backwards in UpdateTime (#64)
This commit is contained in:
parent
e6a863de49
commit
48f05401ce
1 changed files with 4 additions and 2 deletions
|
|
@ -7,9 +7,11 @@ import (
|
|||
|
||||
// UpdateTime updates cached time.
|
||||
func UpdateTime(newTime int64) {
|
||||
if newTime > pgp.latestServerTime {
|
||||
pgp.latestServerTime = newTime
|
||||
pgp.latestClientTime = time.Now()
|
||||
}
|
||||
}
|
||||
|
||||
// GetUnixTime gets latest cached time.
|
||||
func GetUnixTime() int64 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue