mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-02-02 16:28:39 +08:00
fix: StopAgent panics when trace agent disabled (#3981)
Co-authored-by: ansoda <ansoda@gmail.com>
This commit is contained in:
parent
d184f96b13
commit
69bb746a1d
@ -59,7 +59,13 @@ func StartAgent(c Config) {
|
||||
|
||||
// StopAgent shuts down the span processors in the order they were registered.
|
||||
func StopAgent() {
|
||||
_ = tp.Shutdown(context.Background())
|
||||
lock.Lock()
|
||||
defer lock.Unlock()
|
||||
|
||||
if tp != nil {
|
||||
_ = tp.Shutdown(context.Background())
|
||||
tp = nil
|
||||
}
|
||||
}
|
||||
|
||||
func createExporter(c Config) (sdktrace.SpanExporter, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user