Skip to content

Commit

Permalink
import DBOS entrypoints if specified
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdml committed Dec 11, 2024
1 parent 233d104 commit 9334317
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/dbos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { DBOSExecutorContext } from "./eventreceiver";
import { DLogger, GlobalLogger } from "./telemetry/logs";
import { DBOSExecutorNotInitializedError, DBOSInvalidWorkflowTransitionError } from "./error";
import { parseConfigFile } from "./dbos-runtime/config";
import { DBOSRuntimeConfig } from "./dbos-runtime/runtime";
import { DBOSRuntime, DBOSRuntimeConfig } from "./dbos-runtime/runtime";
import { DBOSScheduler, ScheduledArgs, SchedulerConfig, SchedulerRegistrationBase } from "./scheduler/scheduler";
import { configureInstance, getOrCreateClassRegistration, getRegisteredOperations, MethodRegistration, registerAndWrapContextFreeFunction, registerFunctionWrapper } from "./decorators";
import { sleepms } from "./utils";
Expand Down Expand Up @@ -148,6 +148,11 @@ export class DBOS {
DBOS.dbosConfig = dbosConfig;
DBOS.runtimeConfig = runtimeConfig;
}

if (DBOS.runtimeConfig && DBOS.runtimeConfig.entrypoints.length > 0) {
await DBOSRuntime.loadClasses(DBOS.runtimeConfig.entrypoints);
}

DBOSExecutor.globalInstance = new DBOSExecutor(DBOS.dbosConfig);
const executor: DBOSExecutor = DBOSExecutor.globalInstance;
await executor.init();
Expand Down

0 comments on commit 9334317

Please sign in to comment.