mirror of
https://github.com/benbusby/farside.git
synced 2025-04-19 18:38:42 +00:00
Update "last updated" time when fetching from primary node
Fetches from the primary farside node were not updating the "last updated" time, and would only show a placeholder UTC timestamp.
This commit is contained in:
parent
f140cdfd66
commit
6682d5c59a
2 changed files with 5 additions and 0 deletions
|
@ -53,6 +53,7 @@ func queryServiceInstances() {
|
||||||
SetInstances(service.Type, service.Instances)
|
SetInstances(service.Type, service.Instances)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LastUpdate = time.Now().UTC()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,10 @@ func routing(w http.ResponseWriter, r *http.Request, jsEnabled bool) {
|
||||||
path := strings.TrimPrefix(url.Path, "/")
|
path := strings.TrimPrefix(url.Path, "/")
|
||||||
segments := strings.Split(path, "/")
|
segments := strings.Split(path, "/")
|
||||||
|
|
||||||
|
if len(segments[0]) == 0 {
|
||||||
|
http.Redirect(w, r, "", http.StatusTemporaryRedirect)
|
||||||
|
}
|
||||||
|
|
||||||
target, err := services.MatchRequest(segments[0])
|
target, err := services.MatchRequest(segments[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Error during match request: %v\n", err)
|
log.Printf("Error during match request: %v\n", err)
|
||||||
|
|
Loading…
Add table
Reference in a new issue