Replaced werkzeug.utils.cached_property with flask.helpers.locked_cached_property to ensure thread safety