mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Fix broker race condition
This commit is contained in:
parent
c983c13a84
commit
03b2b56f87
2 changed files with 23 additions and 20 deletions
|
@ -154,8 +154,8 @@ func (ctx *BrokerContext) AddSnowflake(id string, proxyType string, natType stri
|
|||
heap.Push(ctx.restrictedSnowflakes, snowflake)
|
||||
}
|
||||
ctx.metrics.promMetrics.AvailableProxies.With(prometheus.Labels{"nat": natType, "type": proxyType}).Inc()
|
||||
ctx.snowflakeLock.Unlock()
|
||||
ctx.idToSnowflake[id] = snowflake
|
||||
ctx.snowflakeLock.Unlock()
|
||||
return snowflake
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue