mirror of
https://github.com/ansible/awx.git
synced 2026-02-21 21:20:08 -03:30
Bug fixes for CentOS
This commit is contained in:
@@ -272,7 +272,7 @@ def run_taskmanager(command_port):
|
|||||||
try:
|
try:
|
||||||
message = command_socket.recv_json(flags=zmq.NOBLOCK)
|
message = command_socket.recv_json(flags=zmq.NOBLOCK)
|
||||||
command_socket.send("1")
|
command_socket.send("1")
|
||||||
except zmq.error.ZMQError,e:
|
except zmq.ZMQError,e:
|
||||||
message = None
|
message = None
|
||||||
if message is not None or (datetime.datetime.now() - last_rebuild).seconds > 60:
|
if message is not None or (datetime.datetime.now() - last_rebuild).seconds > 60:
|
||||||
if message is not None and 'pause' in message:
|
if message is not None and 'pause' in message:
|
||||||
|
|||||||
@@ -305,7 +305,9 @@ def get_system_task_capacity():
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
if hasattr(settings, 'SYSTEM_TASK_CAPACITY'):
|
if hasattr(settings, 'SYSTEM_TASK_CAPACITY'):
|
||||||
return settings.SYSTEM_TASK_CAPACITY
|
return settings.SYSTEM_TASK_CAPACITY
|
||||||
total_mem_value = subprocess.check_output(['free','-m']).split()[7]
|
proc = subprocess.Popen(['free', '-m'], stdout=subprocess.PIPE)
|
||||||
|
out,err = proc.communicate()
|
||||||
|
total_mem_value = out.split()[7]
|
||||||
if int(total_mem_value) <= 2048:
|
if int(total_mem_value) <= 2048:
|
||||||
return 50
|
return 50
|
||||||
return 50 + ((int(total_mem_value) / 1024) - 2) * 75
|
return 50 + ((int(total_mem_value) / 1024) - 2) * 75
|
||||||
|
|||||||
Reference in New Issue
Block a user