Remember indexing error (#2493)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2023-01-07 23:12:56 +07:00 committed by GitHub
parent 3657199e8c
commit 5997d5c6e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 36 additions and 16 deletions

View File

@ -59,11 +59,6 @@ module.exports = {
chunkFilename: '[name].[contenthash].js', chunkFilename: '[name].[contenthash].js',
publicPath: '/' publicPath: '/'
}, },
cache: {
type: 'filesystem',
allowCollectingMemory: true,
cacheLocation: path.resolve(__dirname, '../../common/temp/webpack_cache'),
},
module: { module: {
rules: [ rules: [
{ {

View File

@ -5,4 +5,4 @@ WORKDIR /usr/src/app
COPY bundle.js ./ COPY bundle.js ./
EXPOSE 8080 EXPOSE 8080
CMD [ "node", "bundle.js" ] CMD [ "node", "--enable-source-maps", "bundle.js" ]

View File

@ -8,7 +8,7 @@
"start": "cross-env MONGO_URL=mongodb://localhost:27017 ELASTIC_URL=http://localhost:9200 FRONT_URL=http://localhost:8087 MINIO_ENDPOINT=localhost MINIO_ACCESS_KEY=minioadmin MINIO_SECRET_KEY=minioadmin METRICS_CONSOLE=true SERVER_SECRET=secret ts-node src/__start.ts", "start": "cross-env MONGO_URL=mongodb://localhost:27017 ELASTIC_URL=http://localhost:9200 FRONT_URL=http://localhost:8087 MINIO_ENDPOINT=localhost MINIO_ACCESS_KEY=minioadmin MINIO_SECRET_KEY=minioadmin METRICS_CONSOLE=true SERVER_SECRET=secret ts-node src/__start.ts",
"build": "heft build", "build": "heft build",
"lint:fix": "eslint --fix src", "lint:fix": "eslint --fix src",
"bundle": "esbuild src/__start.ts --bundle --platform=node > bundle.js", "bundle": "esbuild src/__start.ts --bundle --sourcemap=inline --minify --platform=node > bundle.js",
"docker:build": "docker build -t hardcoreeng/transactor .", "docker:build": "docker build -t hardcoreeng/transactor .",
"docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/transactor staging", "docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/transactor staging",
"docker:push": "../../common/scripts/docker_tag.sh hardcoreeng/transactor", "docker:push": "../../common/scripts/docker_tag.sh hardcoreeng/transactor",

View File

@ -151,6 +151,13 @@ export class ContentRetrievalStage implements FullTextPipelineStage {
} }
} }
} catch (err: any) { } catch (err: any) {
const wasError = (doc as any).error !== undefined
await pipeline.update(doc._id, false, { [docKey('error')]: JSON.stringify({ message: err.message, err }) }, {})
if (wasError) {
return
}
// Print error only first time, and update it in doc index
console.error(err) console.error(err)
return return
} }

View File

@ -238,6 +238,13 @@ export class OpenAIEmbeddingsStage implements FullTextPipelineStage {
if (err.message === 'Response code 401 (Unauthorized)') { if (err.message === 'Response code 401 (Unauthorized)') {
this.unauthorized = true this.unauthorized = true
} }
const wasError = doc.attributes.error !== undefined
await pipeline.update(doc._id, false, { [docKey('error')]: JSON.stringify(err) }, {})
if (wasError) {
continue
}
// Print error only first time, and update it in doc index
console.error(err) console.error(err)
continue continue
} }

View File

@ -200,6 +200,13 @@ export class LibRetranslateStage implements TranslationStage {
} }
} }
} catch (err: any) { } catch (err: any) {
const wasError = doc.attributes.error !== undefined
await pipeline.update(doc._id, false, { [docKey('error')]: JSON.stringify(err) }, {})
if (wasError) {
return
}
// Print error only first time, and update it in doc index
console.error(err) console.error(err)
return return
} }

File diff suppressed because one or more lines are too long