1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-08-10 22:11:50 +02:00

Transcribe: Fixes #12863: Improve error handling (#12873)

This commit is contained in:
pedr
2025-08-05 06:53:42 -03:00
committed by GitHub
parent 31c5058d5e
commit 0e19dce0d1
5 changed files with 7 additions and 5 deletions

View File

@@ -11,8 +11,9 @@ QUEUE_RETRY_COUNT=2
QUEUE_MAINTENANCE_INTERVAL=30000
HTR_CLI_DOCKER_IMAGE=joplin/htr-cli:0.0.2
# Fullpath to images folder
HTR_CLI_IMAGES_FOLDER=/home/user/joplin/packages/transcribe/images
# Fullpath to images folder e.g.:
#HTR_CLI_IMAGES_FOLDER=/home/user/joplin/packages/transcribe/images
HTR_CLI_IMAGES_FOLDER=
QUEUE_DRIVER=pg
# QUEUE_DRIVER=sqlite

View File

@@ -1,6 +1,6 @@
#!/bin/bash
if [ ! -f "/images/$1" ]; then
echo "Error: Image file /images/$1 does not exist."
echo "Error: Image file /images/$1 does not exist. Check if HTR_CLI_IMAGES_FOLDER environment variable is set correctly."
exit 1
fi

View File

@@ -43,6 +43,7 @@ const init = async () => {
const checkServerConfigurations = (envVariables: EnvVariables) => {
if (!envVariables.API_KEY) throw Error('API_KEY environment variable not set.');
if (!envVariables.HTR_CLI_IMAGES_FOLDER) throw Error('HTR_CLI_IMAGES_FOLDER environment variable not set. This should point to a folder where images will be stored.');
};
const main = async () => {

View File

@@ -6,7 +6,7 @@ export const defaultEnvValues: EnvVariables = {
QUEUE_RETRY_COUNT: 2,
QUEUE_MAINTENANCE_INTERVAL: 60000,
HTR_CLI_DOCKER_IMAGE: 'joplin/htr-cli:0.0.2',
HTR_CLI_IMAGES_FOLDER: '/home/js/joplin/packages/transcribe/images',
HTR_CLI_IMAGES_FOLDER: '',
QUEUE_DRIVER: 'pg', // 'sqlite'
QUEUE_DATABASE_PASSWORD: '',
QUEUE_DATABASE_NAME: '',

View File

@@ -54,7 +54,7 @@ export default class JobProcessor {
try {
await this.checkForJobs();
} catch (error) {
logger.error(`Error while processing job: ${this.currentJob}`, error);
logger.error(`Error while processing job: ${this.currentJob?.id}`, error);
const e = error as Error;
if (this.currentJob) {
await this.queue.fail(this.currentJob.id, e);