rabbah commented on a change in pull request #2832: Do not cache invalidate 
when adding a DB attachment
URL: 
https://github.com/apache/incubator-openwhisk/pull/2832#discussion_r153965476
 
 

 ##########
 File path: 
common/scala/src/main/scala/whisk/core/database/DocumentFactory.scala
 ##########
 @@ -178,12 +178,19 @@ trait DocumentFactory[W] extends 
MultipleReadersSingleWriterCache[W, DocInfo] {
       implicit val logger = db.logging
       implicit val ec = db.executionContext
 
-      val key = CacheKey(doc.id.asDocInfo)
-      // invalidate the key because attachments update the revision;
-      // do not cache the new attachment (controller does not need it)
-      cacheInvalidate(key, {
-        val src = StreamConverters.fromInputStream(() => bytes)
-        db.attach(doc, attachmentName, contentType, src)
+      val rev = doc match {
+        case w: DocumentRevisionProvider => w.rev
 
 Review comment:
   for completeness, should handle `case _ => /* nothing */ ` as well here and 
below.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to