mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
in tagCommand, AsyncJobExecutionContext doesn't need to be created if it doesn't exist
This commit is contained in:
parent
f1f61e13e5
commit
e5a91e40dd
@ -380,7 +380,7 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl
|
||||
}
|
||||
|
||||
private static void tagCommand(Command cmd) {
|
||||
AsyncJobExecutionContext context = AsyncJobExecutionContext.getCurrentExecutionContext();
|
||||
AsyncJobExecutionContext context = AsyncJobExecutionContext.getCurrent();
|
||||
if (context != null && context.getJob() != null) {
|
||||
AsyncJob job = context.getJob();
|
||||
|
||||
|
||||
@ -182,6 +182,11 @@ public class AsyncJobExecutionContext {
|
||||
return context;
|
||||
}
|
||||
|
||||
// return currentExecutionContext without create it
|
||||
public static AsyncJobExecutionContext getCurrent() {
|
||||
return s_currentExectionContext.get();
|
||||
}
|
||||
|
||||
public static AsyncJobExecutionContext registerPseudoExecutionContext(long accountId, long userId) {
|
||||
AsyncJobExecutionContext context = s_currentExectionContext.get();
|
||||
if (context == null) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user