QFIX: Fix huge statistics send (#8483)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2025-04-07 21:44:18 +07:00 committed by GitHub
parent 92889e2413
commit 9e2baac3d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 8 deletions

View File

@ -172,7 +172,7 @@ export function serveStats (ctx: MeasureContext, onClose?: () => void): void {
const service = payload.extra?.service === 'true' const service = payload.extra?.service === 'true'
const serviceName = (req.query.name as string) ?? '' const serviceName = (req.query.name as string) ?? ''
if (service) { if (service) {
ctx.info('put stats', { service: req.query.name }) ctx.info('put stats', { service: req.query.name, len: req.request.length })
statistics.set(serviceName, { statistics.set(serviceName, {
...(req.request.body as ServiceStatistics), ...(req.request.body as ServiceStatistics),
lastUpdate: Date.now() lastUpdate: Date.now()

View File

@ -701,11 +701,7 @@ export async function backup (
backupSize: 0 backupSize: 0
} }
const workspaceId = wsIds.uuid const workspaceId = wsIds.uuid
ctx = ctx.newChild('backup', { ctx = ctx.newChild('backup', {})
workspaceId,
force: options.force,
timeout: options.timeout
})
let _canceled = false let _canceled = false
const canceled = (): boolean => { const canceled = (): boolean => {

View File

@ -189,7 +189,9 @@ export class WorkspaceWorker {
} else { } else {
void this.exec(async () => { void this.exec(async () => {
await ctx await ctx
.with('workspaceOperation', {}, (ctx) => this.doWorkspaceOperation(ctx, workspace, opt)) .with('workspaceOperation', { mode: workspace.mode }, (ctx) =>
this.doWorkspaceOperation(ctx, workspace, opt)
)
.catch((err) => { .catch((err) => {
Analytics.handleError(err) Analytics.handleError(err)
ctx.error('error', { err }) ctx.error('error', { err })

View File

@ -152,7 +152,7 @@ export class AIControl {
wsIds, wsIds,
this.personUuid, this.personUuid,
this.socialIds, this.socialIds,
this.ctx.newChild(workspace, {}), this.ctx.newChild('create-workspace', {}),
this.openai, this.openai,
this.openaiEncoding, this.openaiEncoding,
info info