humingcheng commented on code in PR #1499:
URL:
https://github.com/apache/servicecomb-service-center/pull/1499#discussion_r1961173197
##########
server/health/health.go:
##########
@@ -40,7 +46,35 @@ func (n NullChecker) Healthy() error {
type DefaultHealthChecker struct {
}
+type SyncReadinessChecker struct {
+ startupTime time.Time
+}
+
+func (src *SyncReadinessChecker) Healthy() error {
+ err := defaultHealth()
+ if err != nil {
+ return err
+ }
+
+ passTime := src.startupTime.Add(30 * time.Second)
+ if !rpc.IsNotReceiveSyncRequest() &&
rpc.GetFirstReceiveTime().Sub(src.startupTime) < 30*time.Second {
+ passTime =
passTime.Add(rpc.GetFirstReceiveTime().Sub(src.startupTime))
Review Comment:
有点绕,实际上是 T_start + 30 + T_firstRecieve - T_start = 30 + T_firstRecieve
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]