Switch file to io stream in recognizer interface
This commit is contained in:
@@ -175,11 +175,17 @@ func (s *TranscribeService) FindAndRunTranscribeJob() error {
|
||||
|
||||
filePath := filepath.Join(baseStorageDir, fileRecord.FileName)
|
||||
|
||||
file, err := os.Open(filePath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
destFileId := uuid.NewString()
|
||||
destFileRecord := fileRecord.CopyWithStorage(destFileId, entity.StorageS3)
|
||||
|
||||
// Запускаем асинхронное распознавание
|
||||
operationID, err := s.recognizer.RecognizeFile(filePath)
|
||||
operationID, err := s.recognizer.Recognize(file, destFileRecord.FileName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user