Compare commits

..

2 Commits

Author SHA1 Message Date
ec637c08dd Fix empty text after recognizing 2025-10-23 11:49:56 +03:00
9788f4cd95 Improve deploy 2025-10-23 11:49:20 +03:00
2 changed files with 10 additions and 3 deletions

View File

@@ -25,4 +25,7 @@ tasks:
requires: requires:
vars: [DOCKER_IMAGE] vars: [DOCKER_IMAGE]
dir: '/home/av/projects/private/pet-project-server' dir: '/home/av/projects/private/pet-project-server'
cmd: ansible-playbook -i production.yml playbook-transcriber.yml --extra-vars 'transcriber_image={{.DOCKER_IMAGE}}' cmds:
- yq --inplace '.transcriber_image = "{{.DOCKER_IMAGE}}"' vars/transcriber.images.yml
- "git commit vars/transcriber.images.yml --message 'Transcriber: release {{.DOCKER_IMAGE}}'"
- ansible-playbook -i production.yml playbook-transcriber-registry.yml playbook-transcriber.yml

View File

@@ -377,6 +377,10 @@ func (s *TranscribeService) FindAndRunTranscribeCheckJob() error {
"operation_id", opId, "operation_id", opId,
"text_length", len(transcriptionText)) "text_length", len(transcriptionText))
if len(transcriptionText) == 0 {
return s.completeJob(job, "Ой, кажется, на аудиозаписи нет текста.")
}
// Завершаем задачу // Завершаем задачу
return s.completeJob(job, transcriptionText) return s.completeJob(job, transcriptionText)
} }
@@ -436,7 +440,7 @@ func (s *TranscribeService) failJob(job *entity.TranscribeJob, jobErr error, hum
return fmt.Errorf("failed to save job: %w", err) return fmt.Errorf("failed to save job: %w", err)
} }
// Отправляем распознанный текст обратно пользователю // Отправляем текст об ошибке пользователю
switch job.Source { switch job.Source {
case entity.SourceTelegram: case entity.SourceTelegram:
if job.TgChatId == nil { if job.TgChatId == nil {