"""Interface for the ows-product-timed-release microservice.""" from flask import g from oto import response from owsrequest import request as requests from sentry_sdk import capture_exception from product.constants import service_name def delete_timed_release(product_id): """Check the status of the product in content review. Args: product_id (int): unique identifier of the product. Returns: Response: Response containing the status details. """ try: result = requests.delete( service_name.OWS_TIMED_RELEASE, f"/scheduled_update/{product_id}" ) except Exception as exception: capture_exception(exception) g.log.exception(exception.args) return response.create_fatal_response( message="Could not connect to {}.".format(service_name.OWS_TIMED_RELEASE) ) return response.Response(status=result.status_code)