Esempio n. 1
0
 def get_uptime(self, site_id, request):
     filepath = MOD_WSGI_FILES.get(site_id)
     if filepath:
         try:
             return datetime.fromtimestamp(os.stat(filepath)[-2])
         except IOError:
             return None
     return None
Esempio n. 2
0
 def restart(self, site_id, request):
     filepath = MOD_WSGI_FILES.get(site_id)
     if filepath:
         try:
             os.utime(filepath, None)
             return True
         except IOError:
             return False
     return False
Esempio n. 3
0
 def can_restart(self, site_id, request):
     filepath = MOD_WSGI_FILES.get(site_id)
     if filepath and os.path.exists(filepath):
         return True
     return False