ocr is working

This commit is contained in:
m
2026-09-16 12:44:48 +02:00
parent 050434325a
commit 906d48702c
21 changed files with 595 additions and 33 deletions
+6
View File
@@ -42,6 +42,12 @@ func setupOcr(t *testing.T) (*gin.Engine, string, *repository.Repository) {
handlers.Store = store
handlers.Ocr = service.NewOcr(repo, uploadDir, "fra+eng", stubEngine{text: "HELLO OCR"})
// Worker OCR borné — le handler n'enfile plus que le job, le traitement
// tourne sur un worker de contexte.
ctx, cancel := context.WithCancel(context.Background())
go handlers.Ocr.Run(ctx, 1)
t.Cleanup(cancel)
gin.SetMode(gin.TestMode)
r := gin.New()
handlers.RegisterRoutes(r)