Commit 1f0b6856 authored by Benjamin "Ziirish" SANS's avatar Benjamin "Ziirish" SANS
Browse files

some improvement on the live monitoring stuff

parent 4d66560e
......@@ -675,6 +675,7 @@ class AsyncRunningBackup(RunningBackup):
This resource is part of the :mod:`burpui.api.async` module.
"""
@api.cache.cached(timeout=60, key_prefix=cache_key)
@ns.marshal_with(
RunningBackup.running_fields,
code=200,
......
......@@ -118,6 +118,7 @@ class RunningBackup(Resource):
'running': fields.Boolean(required=True, description='Is there a backup running right now'),
})
@api.cache.cached(timeout=60, key_prefix=cache_key)
@ns.marshal_with(running_fields, code=200, description='Success')
def get(self, server=None):
"""Tells if a backup is running right now
......
......@@ -229,12 +229,18 @@ class Burp(BUIbackend):
"""See :func:`burpui.misc.backend.interface.BUIbackend.is_one_backup_running`"""
r = []
if agent:
r = self.servers[agent].is_one_backup_running(agent)
try:
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):
r[name] = serv.is_one_backup_running()
try:
r[name] = serv.is_one_backup_running()
except BUIserverException:
r[name] = []
self.running = r
self.refresh = time.time()
......
......@@ -454,6 +454,6 @@ $(function() {
{% if not login -%}
var refresh_running = setInterval(function () {
_check_running();
}, {{ config.REFRESH * 1000 }});
}, {{ config.LIVEREFRESH * 1000 }});
{% endif -%}
});
Supports Markdown
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