Browse Source

server: Prepare "GET /maintenance" endpoint

This is useful for running occasional maintenance tasks.
prometheus-integration
Alexis Hernandez 6 years ago
parent
commit
54a61a11a8
  1. 17
      server/app/controllers/MaintenanceController.scala
  2. 1
      server/conf/routes

17
server/app/controllers/MaintenanceController.scala

@ -0,0 +1,17 @@
package controllers
import controllers.common.{MyJsonController, MyJsonControllerComponents}
import javax.inject.Inject
import org.scalactic.Good
import play.api.libs.json.JsObject
import scala.concurrent.Future
class MaintenanceController @Inject() (
components: MyJsonControllerComponents)
extends MyJsonController(components) {
def run() = public { _ =>
Future.successful(Good(JsObject.empty))
}
}

1
server/conf/routes

@ -4,6 +4,7 @@
# ~~~~ # ~~~~
GET /health controllers.HealthController.check() GET /health controllers.HealthController.check()
# GET /maintenance controllers.MaintenanceController.run()
GET /transactions/:txid controllers.TransactionsController.getTransaction(txid: String) GET /transactions/:txid controllers.TransactionsController.getTransaction(txid: String)
GET /transactions/:txid/raw controllers.TransactionsController.getRawTransaction(txid: String) GET /transactions/:txid/raw controllers.TransactionsController.getRawTransaction(txid: String)

Loading…
Cancel
Save