community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1690418 - /comdev/projects.apache.org/scripts/cronjobs/countaccounts.py
Date Sat, 11 Jul 2015 23:50:13 GMT
Author: sebb
Date: Sat Jul 11 23:50:12 2015
New Revision: 1690418

URL: http://svn.apache.org/r1690418
Log:
COMDEV-146 Fetch time once

Modified:
    comdev/projects.apache.org/scripts/cronjobs/countaccounts.py

Modified: comdev/projects.apache.org/scripts/cronjobs/countaccounts.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/scripts/cronjobs/countaccounts.py?rev=1690418&r1=1690417&r2=1690418&view=diff
==============================================================================
--- comdev/projects.apache.org/scripts/cronjobs/countaccounts.py (original)
+++ comdev/projects.apache.org/scripts/cronjobs/countaccounts.py Sat Jul 11 23:50:12 2015
@@ -29,8 +29,9 @@ with open("../../site/json/foundation/ac
     js = json.loads(f.read())
     f.close()
 
-currentMonth = datetime.now().month
-currentYear = datetime.now().year
+now = datetime.now() # fetch time once
+currentMonth = now.month
+currentYear = now.year
 ym = "%04u-%02u" % (currentYear, currentMonth)
 tym = "%04u%02u" % (currentYear, currentMonth)
 print("Looking for entries for %s" % tym)



Mime
View raw message