Apply redis fix from master branch

This commit is contained in:
VirtuBox
2019-08-12 22:21:29 +02:00
parent 3a8f178c49
commit ae29362823

View File

@@ -1188,6 +1188,18 @@ def post_pref(self, apt_packages, packages):
"maxmemory {0}" "maxmemory {0}"
.format .format
(int(wo_ram*1024*1024*0.1))) (int(wo_ram*1024*1024*0.1)))
else:
Log.debug(self, "Setting maxmemory variable to {0} "
"in redis.conf"
.format(int(wo_ram*1024*1024*0.2)))
WOFileUtils.searchreplace(self,
"/etc/redis/redis.conf",
"# maxmemory <bytes>",
"maxmemory {0}"
.format
(int(wo_ram*1024*1024*0.2)))
Log.debug( Log.debug(
self, "Setting maxmemory-policy variable to " self, "Setting maxmemory-policy variable to "
"allkeys-lru in redis.conf") "allkeys-lru in redis.conf")
@@ -1204,27 +1216,6 @@ def post_pref(self, apt_packages, packages):
"/etc/redis/redis.conf", "/etc/redis/redis.conf",
"tcp-backlog 511", "tcp-backlog 511",
"tcp-backlog 32768") "tcp-backlog 32768")
WOService.restart_service(self, 'redis-server')
else:
Log.debug(self, "Setting maxmemory variable to {0} "
"in redis.conf"
.format(int(wo_ram*1024*1024*0.2)))
WOFileUtils.searchreplace(self,
"/etc/redis/redis.conf",
"# maxmemory <bytes>",
"maxmemory {0}"
.format
(int(wo_ram*1024*1024*0.1)))
Log.debug(
self, "Setting maxmemory-policy variable "
"to allkeys-lru in redis.conf")
WOFileUtils.searchreplace(self,
"/etc/redis/redis.conf",
"# maxmemory-policy "
"noeviction",
"maxmemory-policy "
"allkeys-lru")
WOFileUtils.chown(self, '/etc/redis/redis.conf', WOFileUtils.chown(self, '/etc/redis/redis.conf',
'redis', 'redis', recursive=False) 'redis', 'redis', recursive=False)
WOService.restart_service(self, 'redis-server') WOService.restart_service(self, 'redis-server')