- querylog: fix get data

Close #1589

Squashed commit of the following:

commit 83d1d15f06a67746feb0e82fb71d5ea02f86ab69
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Fri Apr 17 14:11:00 2020 +0300

    - querylog: fix get data
This commit is contained in:
Simon Zolin 2020-04-17 14:40:13 +03:00
parent e24e5741fe
commit 93a597fce4

View File

@ -238,7 +238,7 @@ func (l *queryLog) getData(params getDataParams) map[string]interface{} {
entries := append(memoryEntries, fileEntries...) entries := append(memoryEntries, fileEntries...)
if len(entries) > getDataLimit { if len(entries) > getDataLimit {
// remove extra records // remove extra records
entries = entries[(len(entries) - getDataLimit):] entries = entries[:getDataLimit]
} }
if len(entries) == getDataLimit { if len(entries) == getDataLimit {
// change the "oldest" value here. // change the "oldest" value here.