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))

View File

@@ -1098,7 +1098,7 @@ def detSitePar(opts):
if val and key in ['html', 'php', 'mysql', 'wp',
'wpsubdir', 'wpsubdomain', 'php73']:
typelist.append(key)
elif val and key in ['wpfc', 'wpsc', 'wpredis']:
elif val and key in ['wpfc', 'wpsc', 'wpredis', 'wprocket']:
cachelist.append(key)
if len(typelist) > 1 or len(cachelist) > 1:

View File

@@ -53,8 +53,8 @@ class WOStackStatusController(CementBaseController):
Log.info(self, "PHP7.3-FPM is not installed")
if pargs.mysql:
if ((WOVariables.wo_mysql_host is "localhost") or
(WOVariables.wo_mysql_host is "127.0.0.1")):
if ((WOVariables.wo_mysql_host == "localhost") or
(WOVariables.wo_mysql_host == "127.0.0.1")):
if (WOAptGet.is_installed(self, 'mysql-server') or
WOAptGet.is_installed(self, 'percona-server-server-5.6') or
WOAptGet.is_installed(self, 'mariadb-server')):
@@ -139,8 +139,8 @@ class WOStackStatusController(CementBaseController):
# mysql
if pargs.mysql:
if ((WOVariables.wo_mysql_host is "localhost") or
(WOVariables.wo_mysql_host is "127.0.0.1")):
if ((WOVariables.wo_mysql_host == "localhost") or
(WOVariables.wo_mysql_host == "127.0.0.1")):
if (WOAptGet.is_installed(self, 'mysql-server') or
WOAptGet.is_installed(self, 'percona-server-server-5.6') or
WOAptGet.is_installed(self, 'mariadb-server')):
@@ -223,8 +223,8 @@ class WOStackStatusController(CementBaseController):
Log.info(self, "PHP7.3-FPM is not installed")
if pargs.mysql:
if ((WOVariables.wo_mysql_host is "localhost") or
(WOVariables.wo_mysql_host is "127.0.0.1")):
if ((WOVariables.wo_mysql_host == "localhost") or
(WOVariables.wo_mysql_host == "127.0.0.1")):
if ((WOAptGet.is_installed(self, 'mysql-server') or
WOAptGet.is_installed(self,
'percona-server-server-5.6') or
@@ -306,8 +306,8 @@ class WOStackStatusController(CementBaseController):
Log.info(self, "PHP7.3-FPM is not installed")
if pargs.mysql:
if ((WOVariables.wo_mysql_host is "localhost") or
(WOVariables.wo_mysql_host is "127.0.0.1")):
if ((WOVariables.wo_mysql_host == "localhost") or
(WOVariables.wo_mysql_host == "127.0.0.1")):
if (WOAptGet.is_installed(self, 'mysql-server') or
WOAptGet.is_installed(self, 'percona-server-server-5.6') or
WOAptGet.is_installed(self, 'mariadb-server')):
@@ -389,8 +389,8 @@ class WOStackStatusController(CementBaseController):
Log.info(self, "PHP7.3-FPM is not installed")
if pargs.mysql:
if ((WOVariables.wo_mysql_host is "localhost") or
(WOVariables.wo_mysql_host is "127.0.0.1")):
if ((WOVariables.wo_mysql_host == "localhost") or
(WOVariables.wo_mysql_host == "127.0.0.1")):
if (WOAptGet.is_installed(self, 'mysql-server') or
WOAptGet.is_installed(self, 'percona-server-server-5.6') or
WOAptGet.is_installed(self, 'mariadb-server')):