From 864fd16a47d61148cd66f0432cd5821e4556792e Mon Sep 17 00:00:00 2001 From: chuntaojun Date: Wed, 17 Jul 2024 23:23:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:push=E4=B8=8A=E6=8A=A5=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=87=AA=E5=8A=A8=E6=B3=A8=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/metrics/prometheus/reporter.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/metrics/prometheus/reporter.go b/plugin/metrics/prometheus/reporter.go index c3862a17..fb047ff1 100644 --- a/plugin/metrics/prometheus/reporter.go +++ b/plugin/metrics/prometheus/reporter.go @@ -374,7 +374,9 @@ func (pa *PushAction) Init(initCtx *plugin.InitContext, reporter *PrometheusRepo } func (pa *PushAction) Close() { - pa.pusher.Delete() + if pa.pusher != nil { + pa.pusher.Delete() + } } func (pa *PushAction) Run(ctx context.Context) {