mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-07 16:33:08 +00:00
fix: add a limit of max 10 content topics per query (#3117)
This commit is contained in:
parent
6cfa477817
commit
c80569e758
@ -22,6 +22,7 @@ logScope:
|
|||||||
const
|
const
|
||||||
DefaultPageSize*: uint = 20
|
DefaultPageSize*: uint = 20
|
||||||
MaxPageSize*: uint = 100
|
MaxPageSize*: uint = 100
|
||||||
|
MaxContentTopicsPerQuery*: int = 10
|
||||||
|
|
||||||
# Retention policy
|
# Retention policy
|
||||||
WakuArchiveDefaultRetentionPolicyInterval* = chronos.minutes(30)
|
WakuArchiveDefaultRetentionPolicyInterval* = chronos.minutes(30)
|
||||||
@ -125,6 +126,9 @@ proc findMessages*(
|
|||||||
if cursor == EmptyWakuMessageHash:
|
if cursor == EmptyWakuMessageHash:
|
||||||
return err(ArchiveError.invalidQuery("all zeroes cursor hash"))
|
return err(ArchiveError.invalidQuery("all zeroes cursor hash"))
|
||||||
|
|
||||||
|
if query.contentTopics.len > MaxContentTopicsPerQuery:
|
||||||
|
return err(ArchiveError.invalidQuery("too many content topics"))
|
||||||
|
|
||||||
let maxPageSize =
|
let maxPageSize =
|
||||||
if query.pageSize <= 0:
|
if query.pageSize <= 0:
|
||||||
DefaultPageSize
|
DefaultPageSize
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user