mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-10 18:05:48 +02:00
fix(node-record): concurrent map read and write
This commit is contained in:
parent
ae8646ebfc
commit
c4b8b8f088
1 changed files with 2 additions and 2 deletions
|
@ -129,11 +129,11 @@ func RetrieveNodesStatus(ctx context.Context) {
|
||||||
default:
|
default:
|
||||||
if err := nodeAnalyticRecord(e, ctx); err != nil {
|
if err := nodeAnalyticRecord(e, ctx); err != nil {
|
||||||
logger.Error(err)
|
logger.Error(err)
|
||||||
|
mutex.Lock()
|
||||||
if NodeMap[env.ID] != nil {
|
if NodeMap[env.ID] != nil {
|
||||||
mutex.Lock()
|
|
||||||
NodeMap[env.ID].Status = false
|
NodeMap[env.ID].Status = false
|
||||||
mutex.Unlock()
|
|
||||||
}
|
}
|
||||||
|
mutex.Unlock()
|
||||||
select {
|
select {
|
||||||
case <-retryTicker.C:
|
case <-retryTicker.C:
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue