Other: Use msgpack instead of json in vault

msgpack is much faster at serializing and deserializing than json. Using
it in the vault gives a performance boost.
This commit is contained in:
James Houlahan
2022-10-20 16:36:53 +02:00
parent c7a5b8559c
commit d376b88cf0
7 changed files with 75 additions and 10 deletions

View File

@ -168,13 +168,13 @@ func (vault *Vault) SetAutoUpdate(autoUpdate bool) error {
// GetLastVersion returns the last version of the bridge that was run.
func (vault *Vault) GetLastVersion() *semver.Version {
return vault.get().Settings.LastVersion
return semver.MustParse(vault.get().Settings.LastVersion)
}
// SetLastVersion sets the last version of the bridge that was run.
func (vault *Vault) SetLastVersion(version *semver.Version) error {
return vault.mod(func(data *Data) {
data.Settings.LastVersion = version
data.Settings.LastVersion = version.String()
})
}