Skip to content

Commit

Permalink
Fix up
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite committed Jun 20, 2024
1 parent 5cb1482 commit 525878f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugin-server/src/cdp/hog-executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { convertToHogFunctionFilterGlobal } from './utils'

const MAX_ASYNC_STEPS = 2

const DEFAULT_TIMEOUT = 0.1 // TODO: Change to 100 when the package is updated
const DEFAULT_TIMEOUT_MS = 100

export const formatInput = (bytecode: any, globals: HogFunctionInvocation['globals']): any => {
// Similar to how we generate the bytecode by iterating over the values,
Expand All @@ -27,7 +27,7 @@ export const formatInput = (bytecode: any, globals: HogFunctionInvocation['globa
if (Array.isArray(bytecode) && bytecode[0] === '_h') {
const res = exec(bytecode, {
globals,
timeout: DEFAULT_TIMEOUT,
timeout: DEFAULT_TIMEOUT_MS,
maxAsyncSteps: 0,
})

Expand Down Expand Up @@ -91,7 +91,7 @@ export class HogExecutor {

const filterResult = exec(filters.bytecode, {
globals: filtersGlobals,
timeout: DEFAULT_TIMEOUT,
timeout: DEFAULT_TIMEOUT_MS,
maxAsyncSteps: 0,
})

Expand Down Expand Up @@ -242,7 +242,7 @@ export class HogExecutor {
try {
execRes = exec(state ?? hogFunction.bytecode, {
globals,
timeout: DEFAULT_TIMEOUT, // TODO: Swap this to milliseconds when the package is updated
timeout: DEFAULT_TIMEOUT_MS, // TODO: Swap this to milliseconds when the package is updated
maxAsyncSteps: MAX_ASYNC_STEPS, // NOTE: This will likely be configurable in the future
asyncFunctions: {
// We need to pass these in but they don't actually do anything as it is a sync exec
Expand Down

0 comments on commit 525878f

Please sign in to comment.