diff --git a/Kyoo/HtmlAPI/AdminAPI.cs b/Kyoo/HtmlAPI/AdminAPI.cs
index 8f861e89..22c23900 100644
--- a/Kyoo/HtmlAPI/AdminAPI.cs
+++ b/Kyoo/HtmlAPI/AdminAPI.cs
@@ -10,6 +10,8 @@ namespace Kyoo.Controllers
[HttpGet("scan")]
public IActionResult ScanLibrary([FromServices] ICrawler crawler)
{
+ // The crawler is destroyed before the completion of this task.
+ // TODO implement an hosted service that can queue tasks from the controller.
crawler.StartAsync(new CancellationToken());
return Ok("Scanning");
}
diff --git a/Kyoo/Startup.cs b/Kyoo/Startup.cs
index a7cc97ed..078ea5f8 100644
--- a/Kyoo/Startup.cs
+++ b/Kyoo/Startup.cs
@@ -41,10 +41,10 @@ namespace Kyoo
// services.AddIdentityServer();
services.AddScoped();
+ services.AddScoped();
services.AddSingleton();
services.AddSingleton();
services.AddSingleton();
- services.AddScoped();
services.AddSingleton();
services.AddHostedService();