mirror of
https://github.com/Luzifer/mapshare.git
synced 2024-11-09 13:40:00 +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"`
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue