mirror of
https://github.com/Luzifer/mapshare.git
synced 2024-09-18 23:02:55 +00:00
Auto-set current time for updates
This commit is contained in:
parent
c2320e8701
commit
6f82de4866
@ -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 New Issue
Block a user