[ 
https://issues.apache.org/jira/browse/PIO-110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16141267#comment-16141267
 ] 

ASF GitHub Bot commented on PIO-110:
------------------------------------

Github user shimamoto commented on a diff in the pull request:

    
https://github.com/apache/incubator-predictionio/pull/425#discussion_r135191103
  
    --- Diff: 
data/src/main/scala/org/apache/predictionio/data/api/Webhooks.scala ---
    @@ -115,22 +107,22 @@ private[predictionio] object Webhooks {
         }
     
         eventFuture.flatMap { eventOpt =>
    -      if (eventOpt.isEmpty) {
    -        Future {
    -          val message = s"webhooks connection for ${web} is not supported."
    -          (StatusCodes.NotFound, Map("message" -> message))
    -        }
    -      } else {
    -        val event = eventOpt.get
    -        val data = eventClient.futureInsert(event, appId, channelId).map { 
id =>
    -          val result = (StatusCodes.Created, Map("eventId" -> s"${id}"))
    -
    -          if (stats) {
    -            statsActorRef ! Bookkeeping(appId, result._1, event)
    +      eventOpt match {
    +        case None =>
    +          Future {
    +            val message = s"webhooks connection for ${web} is not 
supported."
    +            (StatusCodes.NotFound, Map("message" -> message))
    +          }
    --- End diff --
    
    Originally `Future {...}`, but here it looks good to use `Future 
successful`.


> Refactor common code shared by CreateServer and BatchPredict
> ------------------------------------------------------------
>
>                 Key: PIO-110
>                 URL: https://issues.apache.org/jira/browse/PIO-110
>             Project: PredictionIO
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 0.12.0-incubating
>            Reporter: Donald Szeto
>            Assignee: Naoki Takezoe
>              Labels: newbie
>
> {{BatchPredict}} was created in PIO-105 and has a substantial amount of 
> shared code with {{CreateServer}}. It would be beneficial to refactor both of 
> them to share as much common code as possible.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to