radondb / xenon
Showing 1 of 3 files from the diff.
Other files ignored by Codecov

@@ -78,7 +78,7 @@
Loading
78 78
	log.Warning("api.v1.raft.trytoleader.[%v].propose.done", address)
79 79
}
80 80
81 -
// RaftTryToLeaderHandler impl.
81 +
// RaftDisableCheckSemiSyncHandler impl.
82 82
func RaftDisableCheckSemiSyncHandler(log *xlog.Log, xenon *server.Server) rest.HandlerFunc {
83 83
	f := func(w rest.ResponseWriter, r *rest.Request) {
84 84
		raftDisableCheckSemiSyncHandler(log, xenon, w, r)
@@ -88,10 +88,33 @@
Loading
88 88
89 89
func raftDisableCheckSemiSyncHandler(log *xlog.Log, xenon *server.Server, w rest.ResponseWriter, r *rest.Request) {
90 90
	address := xenon.Address()
91 -
	log.Warning("api.v1.disablechecksemisync.[%v].prepare.to.disable.check.semi-sync", address)
91 +
	log.Warning("api.v1.raft.disablechecksemisync.[%v].prepare.to.disable.check.semi-sync", address)
92 92
	if err := callx.RaftDisableCheckSemiSyncRPC(address); err != nil {
93 -
		log.Error("api.v1.disablechecksemisync.error:%+v", err)
93 +
		log.Error("api.v1.raft.disablechecksemisync.error:%+v", err)
94 +
		rest.Error(w, err.Error(), http.StatusInternalServerError)
95 +
	}
96 +
	log.Warning("api.v1.raft.disablechecksemisync.[%v].disable.check.semi-sync.done", address)
97 +
}
98 +
99 +
// RaftDisableHandler impl.
100 +
func RaftDisableHandler(log *xlog.Log, xenon *server.Server) rest.HandlerFunc {
101 +
	f := func(w rest.ResponseWriter, r *rest.Request) {
102 +
		raftDisableHandler(log, xenon, w, r)
103 +
	}
104 +
	return f
105 +
}
106 +
107 +
func raftDisableHandler(log *xlog.Log, xenon *server.Server, w rest.ResponseWriter, r *rest.Request) {
108 +
	address := xenon.Address()
109 +
	log.Warning("api.v1.raft.disable.[%v].prepare.to.disable.raft", address)
110 +
	rsp, err := callx.DisableRaftRPC(address)
111 +
	if err != nil {
112 +
		log.Error("api.v1.raft.disable.error:%+v", err)
113 +
		rest.Error(w, err.Error(), http.StatusInternalServerError)
114 +
	}
115 +
	if rsp.RetCode != model.OK {
116 +
		log.Error("api.v1.raft.disable.error:rsp[%v] != [OK]", rsp.RetCode)
94 117
		rest.Error(w, err.Error(), http.StatusInternalServerError)
95 118
	}
96 -
	log.Warning("api.v1.disablechecksemisync.[%v].disable.check.semi-sync.done", address)
119 +
	log.Warning("api.v1.raft.disable.[%v].done", address)
97 120
}
Files Coverage
src 69%
Project Totals (51 files) 69%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading