MCPcopy Index your code
hub / github.com/simstudioai/sim / recordStoredByteSize

Function recordStoredByteSize

apps/sim/lib/logs/execution/logger.ts:259–279  ·  view source on GitHub ↗
(executionData: ExecutionData)

Source from the content-addressed store, hash-verified

257}
258
259function recordStoredByteSize(executionData: ExecutionData): {
260 executionData: ExecutionData
261 storedBytes?: number
262} {
263 const firstBytes = getJsonByteSize(executionData)
264 if (firstBytes === undefined) {
265 return { executionData }
266 }
267
268 const withFirstSize = { ...executionData, executionDataStoredBytes: firstBytes }
269 const secondBytes = getJsonByteSize(withFirstSize)
270 if (secondBytes === undefined || secondBytes === firstBytes) {
271 return { executionData: withFirstSize, storedBytes: secondBytes ?? firstBytes }
272 }
273
274 const withSecondSize = { ...executionData, executionDataStoredBytes: secondBytes }
275 return {
276 executionData: withSecondSize,
277 storedBytes: getJsonByteSize(withSecondSize) ?? secondBytes,
278 }
279}
280
281async function setExecutionLogWriteTimeouts(trx: Pick<typeof db, 'execute'>): Promise<void> {
282 await trx.execute(

Callers 1

Calls 1

getJsonByteSizeFunction · 0.85

Tested by

no test coverage detected