Commit 03aaf71b authored by Benjamin "Ziirish" SANS's avatar Benjamin "Ziirish" SANS

don't use local cache since it is not shared across workers

parent ff35c721
......@@ -561,12 +561,6 @@ class Burp(BUIbackend):
def get_counters(self, name=None, agent=None): # pragma: no cover (hard to test, requires a running backup)
"""See :func:`burpui.misc.backend.interface.BUIbackend.get_counters`"""
res = {}
if agent:
if not name or name not in self.running[agent]:
return res
else:
if not name or name not in self.running:
return res
filemap = self.status('c:{0}\n'.format(name))
if not filemap:
return res
......@@ -596,6 +590,10 @@ class Burp(BUIbackend):
continue
count += 1
# the client was not running
if not res:
return res
if 'bytes' not in res:
res['bytes'] = 0
if set(['start', 'estimated_bytes', 'bytes_in']) <= set(viewkeys(res)):
......@@ -644,8 +642,6 @@ class Burp(BUIbackend):
for cli in cls:
if self.is_backup_running(cli['name']):
res.append(cli['name'])
self.running = res
self.refresh = time.time()
return res
def get_all_clients(self, agent=None):
......
......@@ -533,12 +533,6 @@ class Burp(Burp1):
def get_counters(self, name=None, agent=None):
"""See :func:`burpui.misc.backend.interface.BUIbackend.get_counters`"""
ret = {}
if agent:
if not name or name not in self.running[agent]:
return ret
else:
if not name or name not in self.running:
return ret
query = self.status('c:{0}\n'.format(name), cache=False)
# check the status returned something
if not query:
......@@ -680,8 +674,6 @@ class Burp(Burp1):
for client in clients:
if client['state'] in ['running']:
ret.append(client['name'])
self.running = ret
self.refresh = time.time()
return ret
def _status_human_readable(self, status):
......@@ -808,8 +800,6 @@ class Burp(Burp1):
if 'action' in child and child['action'] == 'backup':
ret['phase'] = child['phase']
break
if name not in self.running:
self.is_one_backup_running()
counters = self.get_counters(name)
if 'percent' in counters:
ret['percent'] = counters['percent']
......
......@@ -42,10 +42,6 @@ class BUIbackend(with_metaclass(ABCMeta, object)):
:type conf: str
"""
# cache the running clients
running = []
# do we need to refresh the cache?
refresh = None
# Defaults config parameters
defaults = {}
......
......@@ -183,7 +183,6 @@ class Burp(BUIbackend):
self.acl_handler = server.acl_handler
self.servers = {}
self.app.config['SERVERS'] = []
self.running = {}
if conf:
for sect in conf.options.keys():
r = re.match('^Agent:(.+)$', sect)
......@@ -233,7 +232,6 @@ class Burp(BUIbackend):
r = self.servers[agent].is_one_backup_running(agent)
except BUIserverException:
pass
self.running[agent] = r
else:
r = {}
for name, serv in iteritems(self.servers):
......@@ -241,9 +239,6 @@ class Burp(BUIbackend):
r[name] = serv.is_one_backup_running()
except BUIserverException:
r[name] = []
self.running = r
self.refresh = time.time()
return r
def _get_version(self, method=None):
......
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