def METHOD_NAME():
    """Reload the unit registry from the database.
    This function is called at startup, and whenever the database is updated.
    """
    import time
    t_start = time.time()
    global _unit_registry
    _unit_registry = None
    reg = pint.UnitRegistry()
    # Define some "standard" additional units
    reg.define('piece = 1')
    reg.define('each = 1 = ea')
    reg.define('dozen = 12 = dz')
    reg.define('hundred = 100')
    reg.define('thousand = 1000')
    # Allow for custom units to be defined in the database
    try:
        from common.models import CustomUnit
        for cu in CustomUnit.objects.all():
            try:
                reg.define(cu.fmt_string())
            except Exception as e:
                logger.error(f'Failed to load custom unit: {cu.fmt_string()} - {e}')
        # Once custom units are loaded, save registry
        _unit_registry = reg
    except Exception:
        # Database is not ready, or CustomUnit model is not available
        pass
    dt = time.time() - t_start
    logger.debug(f'Loaded unit registry in {dt:.3f}s')
    return reg