[Minor] Don't lock Resource in SimplePlanning if not set on Action

This commit is contained in:
Robert von Burg 2020-02-19 22:23:47 +01:00
parent c2ddc0c7ab
commit bf0b4e152e
1 changed files with 6 additions and 2 deletions

View File

@ -19,8 +19,12 @@ public class SimplePlanning extends PlanningPolicy {
@Override
public Resource evaluateAndSetResource(Action action) {
tx().lock(Resource.locatorFor(action.getResourceType(), action.getResourceId()));
return tx().getResourceBy(action.getResourceType(), action.getResourceId());
if (action.hasResourceDefined()) {
tx().lock(action.getResourceLocator());
return tx().getResourceBy(action.getResourceType(), action.getResourceId());
}
return null;
}
/**