Add wprocket to cache list

This commit is contained in:
VirtuBox
2019-08-13 03:46:15 +02:00
parent ae29362823
commit 1dc564f94e
4 changed files with 15 additions and 31 deletions

View File

@@ -26,8 +26,6 @@ class WOCleanController(CementBaseController):
dict(help='Clean all cache', action='store_true')),
(['--fastcgi'],
dict(help='Clean FastCGI cache', action='store_true')),
(['--memcached'],
dict(help='Clean MemCached', action='store_true')),
(['--opcache'],
dict(help='Clean OpCache', action='store_true')),
(['--redis'],
@@ -43,14 +41,11 @@ class WOCleanController(CementBaseController):
pargs.redis)):
self.clean_fastcgi()
if pargs.all:
self.clean_memcached()
self.clean_fastcgi()
self.clean_opcache()
self.clean_redis()
if pargs.fastcgi:
self.clean_fastcgi()
if pargs.memcached:
self.clean_memcached()
if pargs.opcache:
self.clean_opcache()
if pargs.redis:
@@ -65,23 +60,12 @@ class WOCleanController(CementBaseController):
else:
Log.info(self, "Redis is not installed")
@expose(hide=True)
def clean_memcached(self):
try:
if(WOAptGet.is_installed(self, "memcached")):
WOService.restart_service(self, "memcached")
Log.info(self, "Cleaning MemCached")
else:
Log.info(self, "Memcached not installed")
except Exception as e:
Log.debug(self, "{0}".format(e))
Log.error(self, "Unable to restart Memcached", False)
@expose(hide=True)
def clean_fastcgi(self):
if(os.path.isdir("/var/run/nginx-cache")):
Log.info(self, "Cleaning NGINX FastCGI cache")
WOShellExec.cmd_exec(self, "rm -rf /var/run/nginx-cache/*")
WOService.restart_service(self, 'nginx')
else:
Log.error(self, "Unable to clean FastCGI cache", False)
@@ -89,7 +73,7 @@ class WOCleanController(CementBaseController):
def clean_opcache(self):
try:
Log.info(self, "Cleaning opcache")
urllib.request.urlopen(" https://127.0.0.1:22222/cache"
urllib.request.urlopen("https://127.0.0.1:22222/cache"
"/opcache/opgui.php?reset=1").read()
except Exception as e:
Log.debug(self, "{0}".format(e))