Liron Aravot has posted comments on this change.

Change subject: CoCoAsyncTaskHelper: do not clear command if the parent has 
callback
......................................................................


Patch Set 1:

(3 comments)

https://gerrit.ovirt.org/#/c/41687/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CoCoAsyncTaskHelper.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CoCoAsyncTaskHelper.java:

Line 198:                 AsyncTask asyncTask = 
DbFacade.getInstance().getAsyncTaskDao().get(taskId);
Line 199:                 int retVal = 
DbFacade.getInstance().getAsyncTaskDao().remove(taskId);
Line 200:                 if (asyncTask != null && 
!Guid.isNullOrEmpty(asyncTask.getCommandId())) {
Line 201:                     CommandEntity cmdEntity = 
coco.getCommandEntity(asyncTask.getCommandId());
Line 202:                     CommandEntity parentEntity = 
coco.getCommandEntity(asyncTask.getRootCommandId());
> since this check is repetitive in two places, please extract it into a meth
Done
Line 203:                     if (cmdEntity != null && 
!cmdEntity.isCallBackEnabled() && (parentEntity == null || 
!parentEntity.isCallBackEnabled())) {
Line 204:                         coco.removeCommand(asyncTask.getCommandId());
Line 205:                         if 
(!coco.hasCommandEntitiesWithRootCommandId(asyncTask.getRootCommandId())) {
Line 206:                             
coco.removeCommand(asyncTask.getRootCommandId());


Line 199:                 int retVal = 
DbFacade.getInstance().getAsyncTaskDao().remove(taskId);
Line 200:                 if (asyncTask != null && 
!Guid.isNullOrEmpty(asyncTask.getCommandId())) {
Line 201:                     CommandEntity cmdEntity = 
coco.getCommandEntity(asyncTask.getCommandId());
Line 202:                     CommandEntity parentEntity = 
coco.getCommandEntity(asyncTask.getRootCommandId());
Line 203:                     if (cmdEntity != null && 
!cmdEntity.isCallBackEnabled() && (parentEntity == null || 
!parentEntity.isCallBackEnabled())) {
> please use formatter. this line exceeds 120 chars.
Done
Line 204:                         coco.removeCommand(asyncTask.getCommandId());
Line 205:                         if 
(!coco.hasCommandEntitiesWithRootCommandId(asyncTask.getRootCommandId())) {
Line 206:                             
coco.removeCommand(asyncTask.getRootCommandId());
Line 207:                         }


Line 230:                 int retVal = 
DbFacade.getInstance().getAsyncTaskDao().removeByVdsmTaskId(vdsmTaskId);
Line 231:                 if (asyncTask != null && 
!Guid.isNullOrEmpty(asyncTask.getCommandId())) {
Line 232:                     CommandEntity cmdEntity = 
coco.getCommandEntity(asyncTask.getCommandId());
Line 233:                     CommandEntity parentEntity = 
coco.getCommandEntity(asyncTask.getRootCommandId());
Line 234:                     if (cmdEntity != null && 
!cmdEntity.isCallBackEnabled() && (parentEntity == null || 
!parentEntity.isCallBackEnabled())) {
> please use formatter. this line exceeds 120 chars.
Done
Line 235:                         coco.removeCommand(asyncTask.getCommandId());
Line 236:                         if 
(!coco.hasCommandEntitiesWithRootCommandId(asyncTask.getRootCommandId())) {
Line 237:                             
coco.removeCommand(asyncTask.getRootCommandId());
Line 238:                         }


-- 
To view, visit https://gerrit.ovirt.org/41687
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2f939ebbb498a2ef7c0afd32acf75ba6cc37e301
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liron Aravot <lara...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Liron Aravot <lara...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com>
Gerrit-Reviewer: Ravi Nori <rn...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to