diff options
author | Simon Frei <freisim93@gmail.com> | 2020-04-13 10:21:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-13 10:21:07 +0200 |
commit | ab92f8520c0e5178f02826dd2e89c90528d6d50a (patch) | |
tree | aca43fe9ba197c32b6f67a3ce7729535d756a562 /lib/db | |
parent | 0e67c036bbd0c25bbeb2b624658d03f1e7de6710 (diff) |
cmd/syncthing, lib/db: Store upgrade info to throttle queries (fixes #6513) (#6514)v1.5.0-rc.1
Diffstat (limited to 'lib/db')
-rw-r--r-- | lib/db/namespaced.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/db/namespaced.go b/lib/db/namespaced.go index 285799c04c..b7d00bffc7 100644 --- a/lib/db/namespaced.go +++ b/lib/db/namespaced.go @@ -16,13 +16,13 @@ import ( // NamespacedKV is a simple key-value store using a specific namespace within // a leveldb. type NamespacedKV struct { - db *Lowlevel + db backend.Backend prefix string } // NewNamespacedKV returns a new NamespacedKV that lives in the namespace // specified by the prefix. -func NewNamespacedKV(db *Lowlevel, prefix string) *NamespacedKV { +func NewNamespacedKV(db backend.Backend, prefix string) *NamespacedKV { return &NamespacedKV{ db: db, prefix: prefix, @@ -133,18 +133,18 @@ func (n NamespacedKV) prefixedKey(key string) []byte { // NewDeviceStatisticsNamespace creates a KV namespace for device statistics // for the given device. -func NewDeviceStatisticsNamespace(db *Lowlevel, device string) *NamespacedKV { +func NewDeviceStatisticsNamespace(db backend.Backend, device string) *NamespacedKV { return NewNamespacedKV(db, string(KeyTypeDeviceStatistic)+device) } // NewFolderStatisticsNamespace creates a KV namespace for folder statistics // for the given folder. -func NewFolderStatisticsNamespace(db *Lowlevel, folder string) *NamespacedKV { +func NewFolderStatisticsNamespace(db backend.Backend, folder string) *NamespacedKV { return NewNamespacedKV(db, string(KeyTypeFolderStatistic)+folder) } // NewMiscDateNamespace creates a KV namespace for miscellaneous metadata. -func NewMiscDataNamespace(db *Lowlevel) *NamespacedKV { +func NewMiscDataNamespace(db backend.Backend) *NamespacedKV { return NewNamespacedKV(db, string(KeyTypeMiscData)) } |