Author: humbedooh
Date: Fri Aug 2 14:58:11 2019
New Revision: 1864235
URL: http://svn.apache.org/viewvc?rev=1864235&view=rev
Log:
interleave new comments within old cache, so we get updates but keep everything that hasn't
changed or was filtered out.
Modified:
comdev/reporter.apache.org/trunk/site/wizard/comments.py
Modified: comdev/reporter.apache.org/trunk/site/wizard/comments.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/comments.py?rev=1864235&r1=1864234&r2=1864235&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/comments.py (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/comments.py Fri Aug 2 14:58:11 2019
@@ -59,6 +59,7 @@ def main():
cached = True
else:
try:
+ orv = json.load(open(wanted_file, "r"))
rv = requests.get(COMMENTS, headers = {'Authorization': BASIC_AUTH}).json()
except:
dump = json.dumps({
@@ -67,8 +68,11 @@ def main():
sys.stdout.write("Content-Type: application/json\r\nContent-Length: %u\r\n\r\n"
% (len(dump)))
sys.stdout.write(dump)
return
+ # interleave new within old
+ for project in rv:
+ orv[project] = rv[project]
with open(wanted_file, "w") as f:
- f.write(json.dumps(rv))
+ f.write(json.dumps(orv))
cached = False
# Figure out how we're able to access this data
|