Skip to content

Commit

Permalink
Fix added internal events
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite committed Dec 18, 2024
1 parent b3606e3 commit 28a8f54
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions plugin-server/src/main/pluginsServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
CdpCyclotronWorker,
CdpCyclotronWorkerFetch,
CdpFunctionCallbackConsumer,
CdpInternalEventsConsumer,
CdpProcessedEventsConsumer,
} from '../cdp/cdp-consumers'
import { defaultConfig } from '../config/config'
Expand Down Expand Up @@ -451,6 +452,13 @@ export async function startPluginsServer(
services.push(consumer.service)
}

if (capabilities.cdpInternalEvents) {
const hub = await setupHub()
const consumer = new CdpInternalEventsConsumer(hub)
await consumer.start()
services.push(consumer.service)
}

if (capabilities.cdpFunctionCallbacks) {
const hub = await setupHub()
const consumer = new CdpFunctionCallbackConsumer(hub)
Expand Down
2 changes: 2 additions & 0 deletions plugin-server/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export enum PluginServerMode {
recordings_blob_ingestion = 'recordings-blob-ingestion',
recordings_blob_ingestion_overflow = 'recordings-blob-ingestion-overflow',
cdp_processed_events = 'cdp-processed-events',
cdp_internal_events = 'cdp-internal-events',
cdp_function_callbacks = 'cdp-function-callbacks',
cdp_cyclotron_worker = 'cdp-cyclotron-worker',
functional_tests = 'functional-tests',
Expand Down Expand Up @@ -358,6 +359,7 @@ export interface PluginServerCapabilities {
sessionRecordingBlobIngestion?: boolean
sessionRecordingBlobOverflowIngestion?: boolean
cdpProcessedEvents?: boolean
cdpInternalEvents?: boolean
cdpFunctionCallbacks?: boolean
cdpCyclotronWorker?: boolean
appManagementSingleton?: boolean
Expand Down
3 changes: 1 addition & 2 deletions plugin-server/tests/cdp/cdp-internal-events-consumer.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { CdpInternalEventsConsumer } from '../../src/cdp/cdp-consumers'
import { HogWatcherState } from '../../src/cdp/hog-watcher'
import { HogFunctionInvocationGlobals, HogFunctionType } from '../../src/cdp/types'
import { HogFunctionType } from '../../src/cdp/types'
import { Hub, Team } from '../../src/types'
import { closeHub, createHub } from '../../src/utils/db/hub'
import { getFirstTeam, resetTestDatabase } from '../helpers/sql'
Expand Down

0 comments on commit 28a8f54

Please sign in to comment.