Remove self from Crawls and Imports in actors at end of task

In case the user never listens to the stream so that I do not create
inifinitely growing hashmaps in the server memory.
This commit is contained in:
2023-08-29 23:30:00 -04:00
parent ceac234ce7
commit 276f0e17a8
7 changed files with 40 additions and 24 deletions

View File

@@ -27,7 +27,7 @@ pub async fn opml(
let import_id = Base62Uuid::new();
let file_name = field.file_name().map(|s| s.to_string());
let bytes = field.bytes().await?;
let receiver = importer.import(import_id, file_name, bytes).await;
let receiver = importer.import(import_id.as_uuid(), file_name, bytes).await;
{
let mut imports = imports.lock().await;
imports.insert(import_id.as_uuid(), receiver);