INNER CODE UNIT · Python

api_update

GodsScion/Auto_job_applier_linkedIn · app.py:521

def api_update():
    '''Saves the live settings, then fast-forwards this clone to the newest commit.'''
    try:
        _freeze_config()
    except OSError as err:
        return jsonify({"ok": False,
                        "message": "Could not save your settings first: %s" % err}), 500
    return jsonify(updater.self_update())


def _resolve_port(preferred: int = 5000) -> int:
    '''
    Pick a port to serve on. Honors the PORT environment variable (the launcher
    scripts set it). Otherwise tries `preferred`, and if that's taken - e.g. port
    5000 is used by AirPlay Receiver on macOS - asks the OS for any free port so
    the panel always starts instead of crashing with "address already in use".
    '''
    import socket

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…