1
0
Fork 0
mirror of https://github.com/Luzifer/mapshare.git synced 2024-11-09 13:40:00 +00:00

Mind latest retain value: Clear retained value

This commit is contained in:
Knut Ahlers 2020-01-07 00:20:51 +01:00
parent bfcffc983d
commit fac248d94b
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -103,11 +103,13 @@ func handleMapSubmit(w http.ResponseWriter, r *http.Request) {
pos.Time = time.Now()
if pos.Retained {
reqRetainerLock.Lock()
if pos.Retained {
reqRetainer[mapID] = pos
reqRetainerLock.Unlock()
} else {
delete(reqRetainer, mapID)
}
reqRetainerLock.Unlock()
reqDistributorsLock.RLock()
defer reqDistributorsLock.RUnlock()