def index(): successful = helpers.get_dict_from_list('successful', 20) failed = helpers.get_dict_from_list('failed', 20) accs = Account.query.count() servs = Service.query.count() for a in successful: item = Account.query.get(a['account_id']) if item is None: a['alive'] = False else: a['alive'] = True for a in failed: item = Account.query.get(a['account_id']) if item is None: a['alive'] = False else: a['alive'] = True return render_template('index.html', finished=successful, failed=failed, accs=accs, servs=servs)
def get_running(): running = helpers.get_dict_from_list('running') queued = redis.llen('celery') return render_template('running.html', count=len(running), queued=queued, running=running)