UBERF-7665: Fix OOM on partial data (#6134)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2024-07-25 13:32:17 +07:00 committed by GitHub
parent c3a5b88b6e
commit 90a34beb3e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 6 deletions

View File

@ -14,7 +14,7 @@
"_phase:package": "rushx package",
"_phase:docker-build": "rushx docker:build",
"_phase:docker-staging": "rushx docker:staging",
"bundle": "mkdir -p bundle && esbuild src/__start.ts --define:process.env.MODEL_VERSION=$(node ../../common/scripts/show_version.js) --bundle --minify --platform=node --external:sharp > bundle/bundle.js",
"bundle": "mkdir -p bundle && esbuild src/__start.ts --keep-names --define:process.env.MODEL_VERSION=$(node ../../common/scripts/show_version.js) --bundle --minify --platform=node --external:sharp > bundle/bundle.js",
"package": "rm -rf ./dist && cp -r ../../dev/prod/dist . && cp -r ../../dev/prod/public/* ./dist/ && rm ./dist/config.json",
"docker:build": "../../common/scripts/docker_build.sh hardcoreeng/front",
"docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/front staging",

View File

@ -13,7 +13,7 @@
"_phase:bundle": "rushx bundle",
"_phase:docker-build": "rushx docker:build",
"_phase:docker-staging": "rushx docker:staging",
"bundle": "mkdir -p bundle && esbuild src/__start.ts --bundle --external:*.node --sourcemap=inline --minify --platform=node --external:bufferutil --external:utf-8-validate --define:process.env.MODEL_VERSION=$(node ../../common/scripts/show_version.js) --define:process.env.GIT_REVISION=$(../../common/scripts/git_version.sh) > bundle/bundle.js",
"bundle": "mkdir -p bundle && esbuild src/__start.ts --keep-names --bundle --external:*.node --sourcemap=inline --minify --platform=node --external:bufferutil --external:utf-8-validate --define:process.env.MODEL_VERSION=$(node ../../common/scripts/show_version.js) --define:process.env.GIT_REVISION=$(../../common/scripts/git_version.sh) > bundle/bundle.js",
"docker:build": "../../common/scripts/docker_build.sh hardcoreeng/transactor",
"docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/transactor staging",
"docker:push": "../../common/scripts/docker_tag.sh hardcoreeng/transactor",

View File

@ -32,7 +32,6 @@ import { v4 as uuid } from 'uuid'
import { preConditions } from './utils'
import fs from 'fs'
import { Readable } from 'stream'
const cacheControlValue = 'public, max-age=365d'
const cacheControlNoCache = 'public, no-store, no-cache, must-revalidate, max-age=0'
@ -116,8 +115,6 @@ async function getFileRange (
'Last-Modified': new Date(stat.modifiedOn).toISOString()
})
res.send(Readable.toWeb(dataStream))
dataStream.pipe(res)
await new Promise<void>((resolve, reject) => {
@ -306,7 +303,7 @@ export function start (
const admin = payload.extra?.admin === 'true'
res.status(200)
res.setHeader('Content-Type', 'application/json')
res.set('Connection', 'keep-alive')
res.setHeader('Connection', 'keep-alive')
res.setHeader('Cache-Control', cacheControlNoCache)
const json = JSON.stringify({