Pass database as argument to individual face_detector functions

This allows the face detector to use transactions,
such that faces can be detected on media that has not
been fully commited yet.

This solves #214
This commit is contained in:
viktorstrate
2021-03-16 18:26:51 +01:00
parent ba16fc1caa
commit 3ae92086cd
4 changed files with 16 additions and 18 deletions

View File

@@ -361,7 +361,7 @@ func (r *mutationResolver) UserRemoveRootAlbum(ctx context.Context, userID int,
return err
}
if err := face_detection.GlobalFaceDetector.ReloadFacesFromDatabase(); err != nil {
if err := face_detection.GlobalFaceDetector.ReloadFacesFromDatabase(tx); err != nil {
return err
}
}