Skip to content

Commit a05d71a

Browse files
committed
CLOUDSTACK-5752: Use pesudo job context when API dispather directly calls into orchestration flow
1 parent 0965adb commit a05d71a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobExecutionContext.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ public void completeJobAndJoin(JobInfo.Status joinStatus, String joinResult) {
150150

151151
public static AsyncJobExecutionContext getCurrentExecutionContext() {
152152
AsyncJobExecutionContext context = s_currentExectionContext.get();
153+
if (context == null) {
154+
context = registerPseudoExecutionContext(CallContext.current().getCallingAccountId(),
155+
CallContext.current().getCallingUserId());
156+
}
153157
return context;
154158
}
155159

0 commit comments

Comments
 (0)