Skip to content

Commit

Permalink
fix(cdp): test invocation async limits (#25823)
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra authored Oct 25, 2024
1 parent bfd3b50 commit 74fbc2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions plugin-server/src/cdp/cdp-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Hub } from '../types'
import { status } from '../utils/status'
import { delay } from '../utils/utils'
import { FetchExecutor } from './fetch-executor'
import { HogExecutor } from './hog-executor'
import { HogExecutor, MAX_ASYNC_STEPS } from './hog-executor'
import { HogFunctionManager } from './hog-function-manager'
import { HogWatcher, HogWatcherState } from './hog-watcher'
import { HogFunctionInvocationResult, HogFunctionType, LogEntry } from './types'
Expand Down Expand Up @@ -120,7 +120,7 @@ export class CdpApi {
let count = 0

while (!lastResponse || !lastResponse.finished) {
if (count > 5) {
if (count > MAX_ASYNC_STEPS * 2) {
throw new Error('Too many iterations')
}
count += 1
Expand Down
6 changes: 3 additions & 3 deletions plugin-server/src/cdp/hog-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import {
} from './types'
import { convertToHogFunctionFilterGlobal } from './utils'

const MAX_ASYNC_STEPS = 5
const MAX_HOG_LOGS = 25
const MAX_LOG_LENGTH = 10000
export const MAX_ASYNC_STEPS = 5
export const MAX_HOG_LOGS = 25
export const MAX_LOG_LENGTH = 10000
export const DEFAULT_TIMEOUT_MS = 100

const hogExecutionDuration = new Histogram({
Expand Down

0 comments on commit 74fbc2d

Please sign in to comment.