Skip to content

Commit

Permalink
Fix rebase error
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangpengcheng committed May 8, 2021
1 parent 1035347 commit 4df5178
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,12 @@ case class WhiskActionVersionList(namespace: EntityPath,
versions: List[SemVer],
defaultVersion: Option[SemVer]) {
def matchedDocId(version: Option[SemVer]): Option[DocId] = {
version match {
case Some(ver) =>
(version, defaultVersion) match {
case (Some(ver), _) =>
Some(DocId(s"$namespace/$name@$ver"))
case None if defaultVersion.nonEmpty =>
Some(DocId(s"$namespace/$name@${defaultVersion.get}"))
case None if versions.nonEmpty =>
case (None, Some(default)) =>
Some(DocId(s"$namespace/$name@$default"))
case (None, None) if versions.nonEmpty =>
Some(DocId(s"$namespace/$name@${versions.max}"))
case _ =>
None
Expand Down Expand Up @@ -431,16 +431,7 @@ object WhiskActionVersionList extends MultipleReadersSingleWriterCache[WhiskActi
implicit transId: TransactionId,
ec: ExecutionContext): Future[Option[DocId]] = {
get(action, datastore).map { res =>
version match {
case Some(_) =>
Some(DocId(action.copy(version = version).asString))
case None if res.defaultVersion.nonEmpty =>
Some(DocId(action.copy(version = res.defaultVersion).asString))
case None if res.versions.nonEmpty =>
Some(DocId(action.copy(version = Some(res.versions.max)).asString))
case _ =>
None
}
res.matchedDocId(version)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,8 @@ trait WhiskActionsApi extends WhiskCollectionAPI with PostActionActivation with

onComplete(deleteFuture) {
case Success(entities) =>
complete(OK, entities.last)
val versions = entities.map(_.version).mkString(",")
complete(OK, s"[DEL] entity ${entities.last.fullyQualifiedName(false)} for versions $versions")
case Failure(t: NoDocumentException) =>
logging.debug(this, s"[DEL] entity does not exist")
terminate(NotFound)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ object InvokerHealthManager {
action.rev,
healthActionIdentity,
ActivationId.generate(),
docInfo.id,
ControllerInstanceId("health"),
blocking = false,
content = None))
Expand Down

0 comments on commit 4df5178

Please sign in to comment.