-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v2 API touchups #681
v2 API touchups #681
Conversation
@@ -1,6 +1,8 @@ | |||
import { DBOS, WorkflowQueue } from '../src'; | |||
import { generateDBOSTestConfig, setUpDBOSTestDb, TestKvTable } from './helpers'; | |||
|
|||
DBOS.logger.info("This should not cause a kaboom."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha what?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -565,6 +573,42 @@ export class DBOS { | |||
static invoke<T extends ConfiguredInstance>(targetCfg: T): InvokeFuncsInst<T>; | |||
static invoke<T extends object>(targetClass: T): InvokeFuncs<T>; | |||
static invoke<T extends object>(object: T | ConfiguredInstance): InvokeFuncs<T> | InvokeFuncsInst<T> { | |||
if (!DBOS.isWithinWorkflow()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if you call a step normally outside a workflow, not using invoke? Does it work the same as in Python?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that was true for a long time. This is about running a v1 step/transaction function without a HandlerContext.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
These were found during conversion of demo apps to v2: