You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2019/01/23 12:27:19 UTC

[GitHub] rabbah commented on a change in pull request #4234: Add limit to not store activations for a limitted namespace.

rabbah commented on a change in pull request #4234: Add limit to not store activations for a limitted namespace.
URL: https://github.com/apache/incubator-openwhisk/pull/4234#discussion_r250173596
 
 

 ##########
 File path: core/controller/src/main/scala/org/apache/openwhisk/core/controller/Triggers.scala
 ##########
 @@ -148,28 +148,32 @@ trait WhiskTriggersApi extends WhiskCollectionAPI {
             if (activeRules.nonEmpty) {
               val triggerActivationId = activationIdFactory.make()
               logging.info(this, s"[POST] trigger activation id: ${triggerActivationId}")
-              val triggerActivation = WhiskActivation(
-                namespace = user.namespace.name.toPath, // all activations should end up in the one space regardless trigger.namespace
-                entityName.name,
-                user.subject,
-                triggerActivationId,
-                Instant.now(Clock.systemUTC()),
-                Instant.EPOCH,
-                response = ActivationResponse.success(payload orElse Some(JsObject.empty)),
-                version = trigger.version,
-                duration = None)
-              val args: JsObject = trigger.parameters.merge(payload).getOrElse(JsObject.empty)
-
-              activateRules(user, args, trigger.rules.getOrElse(Map.empty))
-                .map(results => triggerActivation.withLogs(ActivationLogs(results.map(_.toJson.compactPrint).toVector)))
-                .recover {
-                  case e =>
-                    logging.error(this, s"Failed to write action activation results to trigger activation: $e")
-                    triggerActivation
-                }
-                .map { activation =>
-                  activationStore.store(activation, context)
-                }
+              if (user.limits.storeActivations.getOrElse(true)) {
 
 Review comment:
   I very much like the idea of consolidating the defaults --- for this and other annotations we use.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services