mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-15 22:56:48 +00:00
feat(GODT-2552): Send first heartbeat.
This commit is contained in:
committed by
Romain Le Jeune
parent
0f621d0aad
commit
b250d49af8
@ -20,6 +20,7 @@ package vault
|
||||
import (
|
||||
"math"
|
||||
"math/rand"
|
||||
"time"
|
||||
|
||||
"github.com/Masterminds/semver/v3"
|
||||
"github.com/ProtonMail/proton-bridge/v3/internal/updater"
|
||||
@ -256,3 +257,15 @@ func (vault *Vault) SetLastUserAgent(userAgent string) error {
|
||||
data.Settings.LastUserAgent = userAgent
|
||||
})
|
||||
}
|
||||
|
||||
// GetLastHeartbeatSent returns the last time heartbeat was sent.
|
||||
func (vault *Vault) GetLastHeartbeatSent() time.Time {
|
||||
return vault.get().Settings.LastHeartbeatSent
|
||||
}
|
||||
|
||||
// SetLastHeartbeatSent store the last time heartbeat was sent.
|
||||
func (vault *Vault) SetLastHeartbeatSent(timestamp time.Time) error {
|
||||
return vault.mod(func(data *Data) {
|
||||
data.Settings.LastHeartbeatSent = timestamp
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user