This commit is contained in:
Kovid Goyal 2016-01-07 15:25:30 +05:30
parent 9c582259be
commit 5a792a0d6a

View File

@ -495,7 +495,7 @@ def singleinstance():
def update_stats():
log = olog = 'stats.log'
if os.geteuid() != 0 or not os.path.exists(log):
if not os.path.exists(log):
return {}
stats = {}
if IS_PRODUCTION:
@ -505,6 +505,8 @@ def update_stats():
except EnvironmentError as err:
if err.errno != errno.ENOENT:
raise
if os.geteuid() != 0:
return stats
log = 'rotated-' + log
os.rename(olog, log)
subprocess.check_call(['/usr/sbin/nginx', '-s', 'reopen'])