You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/03/12 08:19:59 UTC
[GitHub] [servicecomb-kie] tianxiaoliang commented on a change in pull
request #115: health check
tianxiaoliang commented on a change in pull request #115: health check
URL: https://github.com/apache/servicecomb-kie/pull/115#discussion_r391457896
##########
File path: server/resource/v1/history_resource.go
##########
@@ -72,6 +74,29 @@ func (r *HistoryResource) GetRevisions(context *restful.Context) {
}
}
+//HealthCheck provider
+// 1. version
+// 2. reversion
+func (r *HistoryResource) HealthCheck(context *restful.Context) {
+ domain := ReadDomain(context)
+ if domain == nil {
+ WriteErrResponse(context, http.StatusInternalServerError, common.MsgDomainMustNotBeEmpty, common.ContentTypeText)
+ return
+ }
+ resp := &model.DocHealthCheck{}
+ latest, err := service.RevisionService.GetRevision(context.Ctx, domain.(string))
+ if err != nil {
+ WriteErrResponse(context, http.StatusInternalServerError, err.Error(), common.ContentTypeText)
+ return
+ }
+ resp.Revision = strconv.FormatInt(latest, 10)
+ resp.Version = config.MicroserviceDefinition.ServiceDescription.Version
Review comment:
用runtime.Version
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services