def get_modified_timestamp()

in cronjobs/src/commands/build_bundles.py [0:0]


def get_modified_timestamp(url) -> int:
    """
    Return URL modified date as epoch millisecond.
    """
    resp = requests.get(url)
    if not resp.ok:
        filename = url.split("/")[-1]
        print(f"No previous '{filename}' bundle found")  # happens on first run.
        return -1
    dts = resp.headers["Last-Modified"]
    dt = parsedate_to_datetime(dts)
    epoch_msec = int(dt.timestamp() * 1000)
    return epoch_msec