community-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: svn commit: r1822212 - /comdev/reporter.apache.org/trunk/site/getjson-hppdev.py
Date Fri, 26 Jan 2018 01:20:46 GMT
There is a URL caching feature which could be used instead of the
separate download script.
This would ensure the cache was always up to date.
At present the liveliness depends on the download script being run
shortly after the checker runs.
If it is run too early then the cache could be an hour old.

The checking interval can be set as desired to reduce the load on the
checker server and network.

The caching feature works best if the server returns a Last-Modified
date, but I think it will still work without.



On 25 January 2018 at 18:03,  <henkp@apache.org> wrote:
> Author: henkp
> Date: Thu Jan 25 18:03:31 2018
> New Revision: 1822212
>
> URL: http://svn.apache.org/viewvc?rev=1822212&view=rev
> Log:
> get checker json on the fly ; use cache as fallback
>
> Modified:
>     comdev/reporter.apache.org/trunk/site/getjson-hppdev.py
>
> Modified: comdev/reporter.apache.org/trunk/site/getjson-hppdev.py
> URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/getjson-hppdev.py?rev=1822212&r1=1822211&r2=1822212&view=diff
> ==============================================================================
> --- comdev/reporter.apache.org/trunk/site/getjson-hppdev.py (original)
> +++ comdev/reporter.apache.org/trunk/site/getjson-hppdev.py Thu Jan 25 18:03:31 2018
> @@ -277,7 +277,8 @@ if re.match(r"^[-a-zA-Z0-9_.]+$", user):
>      try:
>          request  = urllib2.Request("https://checker.apache.org/json/", None)
>          response = urllib2.urlopen(request, timeout=1)
> -        checker_json = response.read()
> +        content  = response.read()
> +        checker_json = json.loads(content)
>      except:
>          checker_json = readJson(RAOHOME+"data/cache/checker.json", None)
>      checker = {}
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@community.apache.org
For additional commands, e-mail: dev-help@community.apache.org


Mime
View raw message