格式化
This commit is contained in:
@@ -2,14 +2,15 @@ package logger
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"mmw-agent/internal/constants"
|
||||
|
||||
loggerpb "github.com/xtls/xray-core/app/log/command"
|
||||
)
|
||||
|
||||
// RestartLogger triggers the LoggerService restartLogger RPC and waits for completion.
|
||||
// 调用 LoggerService 的 restartLogger 接口并等待完成。
|
||||
func RestartLogger(ctx context.Context, client loggerpb.LoggerServiceClient) error {
|
||||
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
|
||||
ctx, cancel := context.WithTimeout(ctx, constants.DefaultRPCShortTimeout)
|
||||
defer cancel()
|
||||
_, err := client.RestartLogger(ctx, &loggerpb.RestartLoggerRequest{})
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user