Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
Signed-off-by: lhy1024 <[email protected]>
  • Loading branch information
lhy1024 committed Nov 1, 2024
1 parent c20a4f9 commit 64f12cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/versioninfo/versioninfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type Status struct {
Version string `json:"version"`
GitHash string `json:"git_hash"`
StartTimestamp int64 `json:"start_timestamp"`
AreRegionsLoaded bool `json:"are_regions_loaded"`
Loaded bool `json:"loaded"`
}

const (
Expand Down
11 changes: 5 additions & 6 deletions server/api/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@ func newStatusHandler(svr *server.Server, rd *render.Render) *statusHandler {
// @Success 200 {object} versioninfo.Status
// @Router /status [get]
func (h *statusHandler) GetPDStatus(w http.ResponseWriter, _ *http.Request) {
areRegionsLoaded := storage.AreRegionsLoaded(h.svr.GetStorage())
version := versioninfo.Status{
BuildTS: versioninfo.PDBuildTS,
GitHash: versioninfo.PDGitHash,
Version: versioninfo.PDReleaseVersion,
StartTimestamp: h.svr.StartTimestamp(),
AreRegionsLoaded: areRegionsLoaded,
BuildTS: versioninfo.PDBuildTS,
GitHash: versioninfo.PDGitHash,
Version: versioninfo.PDReleaseVersion,
StartTimestamp: h.svr.StartTimestamp(),
Loaded: storage.AreRegionsLoaded(h.svr.GetStorage()),
}

h.rd.JSON(w, http.StatusOK, version)
Expand Down

0 comments on commit 64f12cc

Please sign in to comment.