in tagCommand, AsyncJobExecutionContext doesn't need to be created if it doesn't exist

This commit is contained in:
Anthony Xu 2014-09-17 17:55:56 -07:00
parent f1f61e13e5
commit e5a91e40dd
2 changed files with 6 additions and 1 deletions

View File

@ -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();

View File

@ -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) {