mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 11:14:02 +02:00
...
This commit is contained in:
parent
9c582259be
commit
5a792a0d6a
1 changed files with 3 additions and 1 deletions
|
|
@ -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'])
|
||||
|
|
|
|||
Loading…
Reference in a new issue