mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-12-21 03:46:57 +00:00
Move the default pagination limit into a const
This commit is contained in:
@@ -31,6 +31,9 @@ use crate::{Error, IndexSchedulerOptions, Result, TaskId};
|
|||||||
|
|
||||||
/// The number of database used by queue itself
|
/// The number of database used by queue itself
|
||||||
const NUMBER_OF_DATABASES: u32 = 1;
|
const NUMBER_OF_DATABASES: u32 = 1;
|
||||||
|
/// The default limit for pagination
|
||||||
|
const DEFAULT_LIMIT: usize = 20;
|
||||||
|
|
||||||
/// Database const names for the `IndexScheduler`.
|
/// Database const names for the `IndexScheduler`.
|
||||||
mod db_name {
|
mod db_name {
|
||||||
pub const BATCH_TO_TASKS_MAPPING: &str = "batch-to-tasks-mapping";
|
pub const BATCH_TO_TASKS_MAPPING: &str = "batch-to-tasks-mapping";
|
||||||
@@ -86,7 +89,7 @@ pub struct Query {
|
|||||||
impl Default for Query {
|
impl Default for Query {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
limit: 20,
|
limit: DEFAULT_LIMIT,
|
||||||
from: Default::default(),
|
from: Default::default(),
|
||||||
reverse: Default::default(),
|
reverse: Default::default(),
|
||||||
uids: Default::default(),
|
uids: Default::default(),
|
||||||
|
|||||||
Reference in New Issue
Block a user