update the error message + update the task db size to 20GiB with a limit at 50%

This commit is contained in:
Tamo 2023-04-12 18:46:24 +02:00
parent 9350a7b017
commit b4fabce36d
No known key found for this signature in database
GPG key ID: 20CD8020AFA88D69
4 changed files with 6 additions and 6 deletions

View file

@ -61,7 +61,7 @@ pub enum Error {
SwapDuplicateIndexesFound(Vec<String>),
#[error("Index `{0}` not found.")]
SwapIndexNotFound(String),
#[error("No space left in database. Free some space by deleting tasks.")]
#[error("Meilisearch cannot receive write operations because the limit of the task database has been reached. Please delete tasks to continue performing write operations.")]
NoSpaceLeftInTaskQueue,
#[error(
"Indexes {} not found.",

View file

@ -820,9 +820,9 @@ impl IndexScheduler {
pub fn register(&self, kind: KindWithContent) -> Result<Task> {
let mut wtxn = self.env.write_txn()?;
// if the task doesn't delete anything and 90% of the task queue is full, we must refuse to enqueue the incomming task
// if the task doesn't delete anything and 50% of the task queue is full, we must refuse to enqueue the incomming task
if !matches!(&kind, KindWithContent::TaskDeletion { tasks, .. } if !tasks.is_empty())
&& (self.env.real_disk_size()? * 100) / self.env.map_size()? as u64 > 90
&& (self.env.real_disk_size()? * 100) / self.env.map_size()? as u64 > 50
{
return Err(Error::NoSpaceLeftInTaskQueue);
}