summaryrefslogtreecommitdiff
path: root/system/db
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2017-04-11 09:18:01 -0700
committerSteve Manuel <nilslice@gmail.com>2017-04-11 09:18:01 -0700
commitaf644c49edf6272880b998496f0f4080dbddbc00 (patch)
tree897b8eae5d7573d4612288ccfa8e8f6723f16d9a /system/db
parent6c340440a24b6b0b309c0ef3554297e758823f7d (diff)
updating waitDuration, should determine if this is configurable or not
Diffstat (limited to 'system/db')
-rw-r--r--system/db/content.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/system/db/content.go b/system/db/content.go
index 994860f..23e488f 100644
--- a/system/db/content.go
+++ b/system/db/content.go
@@ -565,13 +565,13 @@ func Query(namespace string, opts QueryOptions) (int, [][]byte) {
}
var sortContentCalls = make(map[string]time.Time)
-var waitDuration = time.Millisecond * 4000
+var waitDuration = time.Millisecond * 2000
func enoughTime(key string, withDelay bool) bool {
last, ok := sortContentCalls[key]
if !ok {
- // no envocation yet
- // track next evocation
+ // no invocation yet
+ // track next invocation
sortContentCalls[key] = time.Now()
return true
}
@@ -587,7 +587,7 @@ func enoughTime(key string, withDelay bool) bool {
select {
case <-time.After(waitDuration):
if enoughTime(key, false) {
- // track next evocation
+ // track next invocation
sortContentCalls[key] = time.Now()
SortContent(key)
} else {
@@ -598,7 +598,7 @@ func enoughTime(key string, withDelay bool) bool {
}()
}
- // track next evocation
+ // track next invocation
sortContentCalls[key] = time.Now()
return true
}