Exemplo n.º 1
0
def start_automation():
    automation = redis_conn.get('automation_enabled') == "true"
    if not automation:
        logout_all()
        enable_automation()

    return redirect(url_for('trackman.login'))
Exemplo n.º 2
0
def autologout_check():
    active = redis_conn.get("dj_active")
    automation = redis_conn.get("automation_enabled")
    # active is None if dj_active has expired (no activity)
    if active is None:
        if automation is None:
            # This should never happen
            pass
        elif automation == "true":
            # automation is running, carry on
            # if automation is enabled, enable_automation was already called
            pass
        else:
            # Automation is not running, end djset if exists and start
            # automation
            logout_all()
            enable_automation()