Uploaded image for project: 'S2Graph'
  1. S2Graph
  2. S2GRAPH-194

Provides a way to remove `service`

    XMLWordPrintableJSON

Details

    • Bug
    • Status: In Progress
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      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.

         
      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)
          }
        }
      

      After deleting all of the serviceColumns associated with it, but there is no part to erase the service.

      Improvement direction.

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

      Attachments

        Activity

          People

            daewon Daewon Jeong
            daewon Daewon Jeong
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: