Skip to content

Commit 434d20e

Browse files
committed
fix(api): use laneMutex in endpointStat.report
1 parent d299db0 commit 434d20e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

internal/api/endpoint_stat.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ func (es *endpointStat) setMetricMeta(metricMeta *format.MetricMetaValue) {
100100

101101
func (es *endpointStat) report(code int, metric string) {
102102
v := time.Since(es.timestamp).Seconds()
103+
es.laneMutex.Lock()
104+
defer es.laneMutex.Unlock()
103105
t := statshouse.Tags{
104106
1: es.endpoint,
105107
2: strconv.Itoa(es.protocol),

0 commit comments

Comments
 (0)