mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-09-22 06:46:34 +08:00
update BytesStringer => PayloadFormatter to pass taskType
This commit is contained in:
@@ -16,7 +16,7 @@ type ListServersResponse struct {
|
||||
Servers []*ServerInfo `json:"servers"`
|
||||
}
|
||||
|
||||
func newListServersHandlerFunc(inspector *asynq.Inspector, bs BytesStringer) http.HandlerFunc {
|
||||
func newListServersHandlerFunc(inspector *asynq.Inspector, pf PayloadFormatter) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
srvs, err := inspector.Servers()
|
||||
if err != nil {
|
||||
@@ -24,7 +24,7 @@ func newListServersHandlerFunc(inspector *asynq.Inspector, bs BytesStringer) htt
|
||||
return
|
||||
}
|
||||
resp := ListServersResponse{
|
||||
Servers: toServerInfoList(srvs, bs),
|
||||
Servers: toServerInfoList(srvs, pf),
|
||||
}
|
||||
if err := json.NewEncoder(w).Encode(resp); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
|
Reference in New Issue
Block a user