def METHOD_NAME(
    title,
    message,
    image_url,
    link_to_upstream_details,
    alert_receive_channel_pk,
    integration_unique_data,
    raw_request_data,
    is_demo=False,
    force_route_id=None,
):
    from apps.alerts.models import Alert, AlertReceiveChannel
    try:
        alert_receive_channel = AlertReceiveChannel.objects.get(pk=alert_receive_channel_pk)
    except AlertReceiveChannel.DoesNotExist:
        return
    if image_url is not None:
        image_url = str(image_url)[:299]
    try:
        alert = Alert.create(
            title=title,
            message=message,
            image_url=image_url,
            link_to_upstream_details=link_to_upstream_details,
            alert_receive_channel=alert_receive_channel,
            integration_unique_data=integration_unique_data,
            raw_request_data=raw_request_data,
            force_route_id=force_route_id,
            is_demo=is_demo,
        )
        logger.info(f"Created alert {alert.pk} for alert group {alert.group.pk}")
    except ConcurrentUpdateError:
        # This error is raised when there are concurrent updates on AlertGroupCounter due to optimistic lock on it.
        # The idea is to not block the worker with a database lock and retry the task in case of concurrent updates.
        countdown = random.randint(1, 10)
        METHOD_NAME.apply_async(
            (
                title,
                message,
                image_url,
                link_to_upstream_details,
                alert_receive_channel_pk,
                integration_unique_data,
                raw_request_data,
            ),
            countdown=countdown,
        )
        logger.warning(f"Retrying the task gracefully in {countdown} seconds due to ConcurrentUpdateError")