NOISSUE - Remove messages limit in influxdb-reader (#968)

* NOISSUE - Remove messages limit in influxdb-reader

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>

* Rm too large limit test

Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
This commit is contained in:
Manuel Imperiale 2019-11-26 18:58:45 +01:00 committed by GitHub
parent 6da650645f
commit 87dd91e328
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 19 deletions

View File

@ -14,10 +14,7 @@ import (
"github.com/mainflux/mainflux/transformers/senml"
)
const (
maxLimit = 100
countCol = "count"
)
const countCol = "count"
var _ readers.MessageRepository = (*influxRepository)(nil)
@ -35,10 +32,6 @@ func New(client influxdata.Client, database string) readers.MessageRepository {
}
func (repo *influxRepository) ReadAll(chanID string, offset, limit uint64, query map[string]string) (readers.MessagesPage, error) {
if limit > maxLimit {
limit = maxLimit
}
condition := fmtCondition(chanID, query)
cmd := fmt.Sprintf(`SELECT * FROM messages WHERE %s ORDER BY time DESC LIMIT %d OFFSET %d`, condition, limit, offset)
q := influxdata.Query{

View File

@ -110,17 +110,6 @@ func TestReadAll(t *testing.T) {
Messages: messages[0:10],
},
},
"read message page for too large limit": {
chanID: chanID,
offset: 0,
limit: 101,
page: readers.MessagesPage{
Total: msgsNum,
Offset: 0,
Limit: 101,
Messages: messages[0:100],
},
},
"read message page for non-existent channel": {
chanID: "2",
offset: 0,