1
0
Fork 0
mirror of https://github.com/Luzifer/mapshare.git synced 2024-12-20 14:41:19 +00:00

Auto-set current time for updates

This commit is contained in:
Knut Ahlers 2020-01-07 00:18:48 +01:00
parent c2320e8701
commit 6f82de4866
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -16,6 +16,7 @@ type position struct {
Lat float64 `json:"lat"`
Lon float64 `json:"lon"`
Retained bool `json:"retained"`
SenderID string `json:"sender_id"`
Time time.Time `json:"time"`
}
@ -100,6 +101,8 @@ func handleMapSubmit(w http.ResponseWriter, r *http.Request) {
return
}
pos.Time = time.Now()
if pos.Retained {
reqRetainerLock.Lock()
reqRetainer[mapID] = pos