more cleanup, fixes

This commit is contained in:
Sanjana Rajan 2018-06-04 17:50:26 -07:00
parent c254bd5d44
commit 04ebe6d459
9 changed files with 33 additions and 53 deletions

View file

@ -6,19 +6,18 @@ import (
// UpdateTime update cached time
func (o *OpenPGP) UpdateTime(newTime int64) {
o.lastestServerTime = newTime
o.latestServerTime = newTime
}
//GetTime get latest cached time
func (o *OpenPGP) GetTime() int64 {
return o.lastestServerTime
return o.latestServerTime
}
func (o *OpenPGP) getNow() time.Time {
if o.lastestServerTime > 0 {
tm := time.Unix(o.lastestServerTime, 0)
return tm
if o.latestServerTime > 0 {
return time.Unix(o.latestServerTime, 0)
}
return time.Now()