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 serviceName = (req.query.name as string) ?? ''
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, {
...(req.request.body as ServiceStatistics),
lastUpdate: Date.now()

View File

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

View File

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

View File

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