mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-09-08 10:14:35 +08:00
Go: add more commands and GCS supports (#16741)
### Summary 1. GCS supports 2. More commands ``` RAGFlow(admin)> ping store; SUCCESS RAGFlow(admin)> ping engine; SUCCESS RAGFlow(admin)> ping cache; SUCCESS ``` --------- Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
@@ -123,18 +123,18 @@ func (n *NatsEngine) ShowMessageQueue() (map[string]string, error) {
|
||||
result["message_count"] = strconv.FormatUint(info.State.Msgs, 10)
|
||||
|
||||
consumer, err := n.stream.Consumer(ctx, "RAGFLOW_CONSUMER")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get existing consumer: %w", err)
|
||||
if err == nil {
|
||||
var consumerInfo *jetstream.ConsumerInfo
|
||||
consumerInfo, err = consumer.Info(ctx)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get consumer info: %w", err)
|
||||
}
|
||||
result["pending_count"] = strconv.FormatUint(consumerInfo.NumPending, 10)
|
||||
result["waiting_count"] = strconv.Itoa(consumerInfo.NumWaiting)
|
||||
result["ack_pending_count"] = strconv.Itoa(consumerInfo.NumAckPending)
|
||||
result["redelivered_count"] = strconv.Itoa(consumerInfo.NumRedelivered)
|
||||
}
|
||||
|
||||
consumerInfo, err := consumer.Info(ctx)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get consumer info: %w", err)
|
||||
}
|
||||
result["pending_count"] = strconv.FormatUint(consumerInfo.NumPending, 10)
|
||||
result["waiting_count"] = strconv.Itoa(consumerInfo.NumWaiting)
|
||||
result["ack_pending_count"] = strconv.Itoa(consumerInfo.NumAckPending)
|
||||
result["redelivered_count"] = strconv.Itoa(consumerInfo.NumRedelivered)
|
||||
return result, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user