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

@@ -98,6 +98,7 @@ pub async fn main() -> Result<()> {
.max_connections(env::var("DATABASE_MAX_CONNECTIONS")?.parse()?)
.connect(&env::var("DATABASE_URL")?)
.await?;
let crawls = Arc::new(Mutex::new(HashMap::new()));
let cli: Cli = Cli::parse();
@@ -147,6 +148,7 @@ pub async fn main() -> Result<()> {
client.clone(),
domain_locks.clone(),
env::var("CONTENT_DIR")?,
crawls.clone(),
);
let _ = feed_crawler.crawl(id).await;
}