aboutsummaryrefslogtreecommitdiff
path: root/xmpp
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2022-04-01 19:35:54 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2022-04-01 19:35:54 +0300
commit86cbbcb8bd3c62f0e1af0188cf7fb83cb89df6c4 (patch)
tree36a2105a5d40fe134a519ce28af65bc5b5620c83 /xmpp
parent2f38af12a28cdf92d587711965c170fbeafa41d8 (diff)
gofmtv1.2.0
Diffstat (limited to 'xmpp')
-rw-r--r--xmpp/component.go15
-rw-r--r--xmpp/gateway/storage.go1
2 files changed, 9 insertions, 7 deletions
diff --git a/xmpp/component.go b/xmpp/component.go
index 1749100..f5143ea 100644
--- a/xmpp/component.go
+++ b/xmpp/component.go
@@ -23,16 +23,17 @@ var db *persistence.SessionsYamlDB
var sessionLock sync.Mutex
const (
- B uint64 = 1
- KB = B << 10
- MB = KB << 10
- GB = MB << 10
- TB = GB << 10
- PB = TB << 10
- EB = PB << 10
+ B uint64 = 1
+ KB = B << 10
+ MB = KB << 10
+ GB = MB << 10
+ TB = GB << 10
+ PB = TB << 10
+ EB = PB << 10
maxUint64 uint64 = (1 << 64) - 1
)
+
var sizeRegex = regexp.MustCompile("\\A([0-9]+) ?([KMGTPE]?B?)\\z")
// NewComponent starts a new component and wraps it in
diff --git a/xmpp/gateway/storage.go b/xmpp/gateway/storage.go
index a3fad79..fcc381b 100644
--- a/xmpp/gateway/storage.go
+++ b/xmpp/gateway/storage.go
@@ -11,6 +11,7 @@ import (
// StorageQuota is a value from config parsed to bytes number
var StorageQuota uint64
+
// CachedStorageSize estimates the storage size between full rescans
var CachedStorageSize uint64
var StorageLock = sync.Mutex{}