Revert "add: multiprocessing for better scalability"

This reverts commit 5c3f65ed.
parent ebf8294d
# -*- coding: utf8 -*-
# This is a submodule we can also use "from ..api import api"
from . import api, cache_key, parallel_loop
from . import api, cache_key
from ..exceptions import BUIserverException
from flask.ext.restplus import Resource, fields
......@@ -63,27 +63,22 @@ class ServersStats(Resource):
check = True
allowed = api.bui.acl.servers(current_user.get_id())
def get_servers_info(serv, output):
for serv in api.bui.cli.servers:
try:
if check:
if serv in allowed:
output.put({
r.append({
'name': serv,
'clients': len(api.bui.acl.clients(current_user.get_id(), serv)),
'alive': api.bui.cli.servers[serv].ping()
})
return
else:
output.put({
r.append({
'name': serv,
'clients': len(api.bui.cli.servers[serv].get_all_clients(serv)),
'alive': api.bui.cli.servers[serv].ping()
})
return
output.put(None)
except BUIserverException as e:
output.put(str(e))
r = parallel_loop(get_servers_info, api.bui.cli.servers)
api.abort(500, str(e))
return r
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment