mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-09-17 10:16:57 +00:00
fix race condition with lastSuccess
convert responseCache
This commit is contained in:
parent
b94bcf743e
commit
6abd30d71c
3 changed files with 40 additions and 23 deletions
|
@ -97,6 +97,12 @@ func newStatsData() *StatsData {
|
|||
DisconnectReasons: make(map[string]uint64),
|
||||
ClientVersions: make(map[string]uint64),
|
||||
StatsDataVersion: StatsDataVersion,
|
||||
Health: struct {
|
||||
IRC bool
|
||||
Backend map[string]time.Time
|
||||
}{
|
||||
Backend: make(map[string]time.Time),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -162,6 +168,11 @@ func updatePeriodicStats() {
|
|||
|
||||
{
|
||||
Statistics.Health.IRC = authIrcConnection.Connected()
|
||||
Backend.lastSuccessLock.Lock()
|
||||
for k, v := range Backend.lastSuccess {
|
||||
Statistics.Health.Backend[k] = v
|
||||
}
|
||||
Backend.lastSuccessLock.Unlock()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue