You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@s2graph.apache.org by "Daewon Jeong (JIRA)" <ji...@apache.org> on 2018/03/30 03:00:00 UTC

[jira] [Created] (S2GRAPH-194) Provides a way to remove `service`

Daewon Jeong created S2GRAPH-194:
------------------------------------

             Summary:  Provides a way to remove `service`
                 Key: S2GRAPH-194
                 URL: https://issues.apache.org/jira/browse/S2GRAPH-194
             Project: S2Graph
          Issue Type: Bug
            Reporter: Daewon Jeong


I was looking for a bug while looking at the API to create the `deleteService` function in `graphql`.

The code below is a management API that delete the service.
{noformat}
   
def delete (id: Int) (implicit session: DBSession = AutoSession) = \{
    val service = findById (id)
    val serviceName = service.serviceName
    sql "" delete from service_columns where id = $ {id} "". execute.apply ()
    val cacheKeys = List (s "id = $ id", s "serviceName = $ serviceName")
    cacheKeys.foreach \{key =>
      expireCache (key)
      expireCaches (key)
    }
  }
{noformat}
After deleting all of the serviceColumns associated with it, but there is no part to erase the service.

Improvement direction.
 # Check whether the label associated with the service exists
 # Add a friendly error message (change return type from Boolean to Try)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)