community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r1745920 - in /comdev/nearby_people: local_settings.py.example nearby/foaf.py
Date Sat, 28 May 2016 18:49:32 GMT
Author: nick
Date: Sat May 28 18:49:32 2016
New Revision: 1745920

URL: http://svn.apache.org/viewvc?rev=1745920&view=rev
Log:
Configurable refresh time

Modified:
    comdev/nearby_people/local_settings.py.example
    comdev/nearby_people/nearby/foaf.py

Modified: comdev/nearby_people/local_settings.py.example
URL: http://svn.apache.org/viewvc/comdev/nearby_people/local_settings.py.example?rev=1745920&r1=1745919&r2=1745920&view=diff
==============================================================================
--- comdev/nearby_people/local_settings.py.example (original)
+++ comdev/nearby_people/local_settings.py.example Sat May 28 18:49:32 2016
@@ -13,6 +13,9 @@ COMDEV_DOAP = os.path.join(BASE_PATH, "d
 SPEAKERS_DOAP = os.path.join(BASE_PATH, "data/local-outreach/ApacheSpeakers.rdf")
 PEOPLE_FOAF_PATH = os.path.join(BASE_PATH, "data/info/")
 
+# How often to reload all the DOAP/FOAF files, in hours
+FOAF_REFRESH_HOURS = 2
+
 # Google Maps settings
 GMAPS_KEY = "ABQIAAAAteF8gqn96L8K4RRZYtk7ZRQv7OBTi813IEDuwD3BusDViujKIBTUfK-gV5SL7dqLeRkgc0jLmyXgkg"
# localhost
 #GMAPS_KEY = "ABQIAAAAKzqK7s3QLJgbVNLowesmvBRZUAEs3HYX8hgK-I5Eho3zsmHV-RQBJhSLW6bIoahGVe1Ap9pWhcewGw"
# apache.org

Modified: comdev/nearby_people/nearby/foaf.py
URL: http://svn.apache.org/viewvc/comdev/nearby_people/nearby/foaf.py?rev=1745920&r1=1745919&r2=1745920&view=diff
==============================================================================
--- comdev/nearby_people/nearby/foaf.py (original)
+++ comdev/nearby_people/nearby/foaf.py Sat May 28 18:49:32 2016
@@ -18,7 +18,8 @@
 # Parses and caches foaf files
 
 from xml.dom.minidom import parse
-from settings import PEOPLE_FOAF_PATH, PEOPLE_FOAF_NAMESPACE, PEOPLE_FOAF_ALT_NAMESPACE
+from settings import FOAF_REFRESH_HOURS, PEOPLE_FOAF_PATH, \
+                     PEOPLE_FOAF_NAMESPACE, PEOPLE_FOAF_ALT_NAMESPACE
 import datetime
 import geo_helper
 import sys,os
@@ -72,7 +73,7 @@ class FOAF(object):
             self._refresh()
         if not self.updated_at:
             self._refresh()
-        if datetime.datetime.utcnow() - self.updated_at > datetime.timedelta(hours=12):
+        if datetime.datetime.utcnow() - self.updated_at > datetime.timedelta(hours=FOAF_REFRESH_HOURS):
             self._refresh()
 
     @staticmethod



Mime
View raw message