mirror of
https://github.com/chubin/wttr.in
synced 2025-01-26 02:34:59 +00:00
Ignore local queries in stats
This commit is contained in:
parent
307476764a
commit
4599029329
1 changed files with 4 additions and 2 deletions
|
@ -104,7 +104,10 @@ func (rp *RequestProcessor) ProcessRequest(r *http.Request) (*responseWithHeader
|
|||
err error
|
||||
)
|
||||
|
||||
rp.stats.Inc("total")
|
||||
ip := util.ReadUserIP(r)
|
||||
if ip != "127.0.0.1" {
|
||||
rp.stats.Inc("total")
|
||||
}
|
||||
|
||||
// Main routing logic.
|
||||
if rh := rp.router.Route(r); rh != nil {
|
||||
|
@ -167,7 +170,6 @@ func (rp *RequestProcessor) ProcessRequest(r *http.Request) (*responseWithHeader
|
|||
}
|
||||
|
||||
// How many IP addresses are known.
|
||||
ip := util.ReadUserIP(r)
|
||||
_, err = rp.geoIPCache.Read(ip)
|
||||
if err == nil {
|
||||
rp.stats.Inc("geoip")
|
||||
|
|
Loading…
Reference in a new issue