1
0
Fork 0
mirror of https://github.com/Luzifer/mapshare.git synced 2024-12-20 22:51:19 +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() pos.Time = time.Now()
if pos.Retained {
reqRetainerLock.Lock() reqRetainerLock.Lock()
if pos.Retained {
reqRetainer[mapID] = pos reqRetainer[mapID] = pos
reqRetainerLock.Unlock() } else {
delete(reqRetainer, mapID)
} }
reqRetainerLock.Unlock()
reqDistributorsLock.RLock() reqDistributorsLock.RLock()
defer reqDistributorsLock.RUnlock() defer reqDistributorsLock.RUnlock()