bug(lib): drop env on last use

fixes the `too many open files` error when running tests by closing the
environment on last drop
This commit is contained in:
Marin Postma
2021-12-15 17:55:39 +01:00
parent ea0a5271f7
commit b28a465304
8 changed files with 51 additions and 24 deletions

View File

@@ -32,7 +32,7 @@ pub trait TaskPerformer: Sync + Send + 'static {
async fn finish(&self, batch: &Batch);
}
pub fn create_task_store<P>(env: heed::Env, performer: Arc<P>) -> Result<TaskStore>
pub fn create_task_store<P>(env: Arc<heed::Env>, performer: Arc<P>) -> Result<TaskStore>
where
P: TaskPerformer,
{