Merged in feature/doc_import (pull request #177)

integration of background processor

* integration part 1

* feature working

* fix mimetype issue
This commit is contained in:
Jay Brown
2025-08-20 19:01:13 +00:00
parent 7a693d42f5
commit 720a84be92
34 changed files with 2682 additions and 193 deletions
+10
View File
@@ -37,6 +37,7 @@ func (s *Controllers) UploadDocument(ctx echo.Context, clientId ClientID) error
err = s.svc.DocumentUpload.Upload(ctx.Request().Context(), documentupload.File{
ClientID: clientId,
Content: src,
Filename: file.Filename,
})
if err != nil {
slog.Error("unable to get form data", "error", err)
@@ -185,6 +186,15 @@ func (s *Controllers) UploadDocumentBatch(ctx echo.Context, clientId ClientID) e
"client_id", clientId,
)
// Signal background runner to process new batch
if runner := s.cfg.GetBackgroundRunner(); runner != nil {
if err := runner.Signal(); err != nil {
slog.Warn("Failed to signal background runner", "error", err, "batch_id", batchID)
} else {
slog.Info("Background runner signaled for batch processing", "batch_id", batchID)
}
}
// Return 202 Accepted with batch ID and status URL
statusUrl := fmt.Sprintf("/clients/%s/documents/batches/%s", clientId, batchID)
response := BatchUploadResponse{