Limit the number of script operations

This commit is contained in:
Clément Renault 2024-05-10 12:22:13 +02:00
parent 082b171d45
commit 6d5b79bc1f
No known key found for this signature in database
GPG key ID: F250A4C4E3AE5F5F

View file

@ -218,7 +218,10 @@ where
output
}
let engine = Engine::new();
let mut engine = Engine::new();
//It is an arbitrary value. We need to let users define this in the settings.
engine.set_max_operations(1_000_000);
let ast = engine.compile(code).unwrap();
let fields_ids_map = self.index.fields_ids_map(self.wtxn)?;
let primary_key = self.index.primary_key(self.wtxn)?.unwrap();