mirror of
https://github.com/Luzifer/mapshare.git
synced 2024-12-20 22:51:19 +00:00
Auto-set current time for updates
This commit is contained in:
parent
c2320e8701
commit
6f82de4866
1 changed files with 3 additions and 0 deletions
|
@ -16,6 +16,7 @@ type position struct {
|
||||||
Lat float64 `json:"lat"`
|
Lat float64 `json:"lat"`
|
||||||
Lon float64 `json:"lon"`
|
Lon float64 `json:"lon"`
|
||||||
Retained bool `json:"retained"`
|
Retained bool `json:"retained"`
|
||||||
|
SenderID string `json:"sender_id"`
|
||||||
Time time.Time `json:"time"`
|
Time time.Time `json:"time"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,6 +101,8 @@ func handleMapSubmit(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pos.Time = time.Now()
|
||||||
|
|
||||||
if pos.Retained {
|
if pos.Retained {
|
||||||
reqRetainerLock.Lock()
|
reqRetainerLock.Lock()
|
||||||
reqRetainer[mapID] = pos
|
reqRetainer[mapID] = pos
|
||||||
|
|
Loading…
Reference in a new issue