添加 health_check.go
This commit is contained in:
12
health_check.go
Normal file
12
health_check.go
Normal file
@@ -0,0 +1,12 @@
|
||||
// health_check.go
|
||||
func monitorOrderProcess() {
|
||||
http.HandleFunc("/api/order/status", func(w http.ResponseWriter, r *http.Request) {
|
||||
status := map[string]interface{}{
|
||||
"running": isOrderProcessRunning(),
|
||||
"last_success": lastSuccessTime,
|
||||
"total_orders": totalOrders,
|
||||
"failed_orders": failedOrders,
|
||||
}
|
||||
json.NewEncoder(w).Encode(status)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user