Skip to content

Commit

Permalink
Only get action metadata when working with rules. (#3718)
Browse files Browse the repository at this point in the history
Working with rules only requires to make sure certain actions exist. We only need their metadata, not the full blown action including its code.
  • Loading branch information
markusthoemmes authored and rabbah committed Jun 6, 2018
1 parent 5aa8fc7 commit 583b154
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ trait WhiskRulesApi extends WhiskCollectionAPI with ReferencedEntities {
* @return future that completes with references trigger and action if they exist
*/
private def checkTriggerAndActionExist(trigger: FullyQualifiedEntityName, action: FullyQualifiedEntityName)(
implicit transid: TransactionId): Future[(WhiskTrigger, WhiskAction)] = {
implicit transid: TransactionId): Future[(WhiskTrigger, WhiskActionMetaData)] = {

for {
triggerExists <- WhiskTrigger.get(entityStore, trigger.toDocId) recoverWith {
Expand All @@ -408,7 +408,7 @@ trait WhiskRulesApi extends WhiskCollectionAPI with ReferencedEntities {
}

actionExists <- WhiskAction.resolveAction(entityStore, action) flatMap { resolvedName =>
WhiskAction.get(entityStore, resolvedName.toDocId)
WhiskActionMetaData.get(entityStore, resolvedName.toDocId)
} recoverWith {
case _: NoDocumentException =>
Future.failed {
Expand Down

0 comments on commit 583b154

Please sign in to comment.