mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-22 16:27:22 +00:00
Remember indexing error (#2493)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
3657199e8c
commit
5997d5c6e9
@ -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: [
|
||||||
{
|
{
|
||||||
|
@ -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" ]
|
||||||
|
@ -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",
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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
Loading…
Reference in New Issue
Block a user