(result, domain)
Check import result and send internal alerts based on result

    :param result: dict that should include key "created_count" pointing to an int
Check import result and send internal alerts based on result
Check import result and send internal alerts based on result
def _alert_on_result(result, domain):
    """ Check import result and send internal alerts based on result

    :param result: dict that should include key "created_count" pointing to an int
    """

    if result['created_count'] > 10000:
        message = "A case import just uploaded {num} new cases to HQ. {domain} might be scaling operations".format(
            num=result['created_count'],
            domain=domain
        )
        alert = AbnormalUsageAlert(source="case importer", domain=domain, message=message)
        send_abnormal_usage_alert.delay(alert)
def _alert_on_result ( result , domain ) : if result [ 'created_count' ] > 10000 : message = "A case import just uploaded {num} new cases to HQ. {domain} might be scaling operations" . format ( num = result [ 'created_count' ] , domain = domain ) alert = AbnormalUsageAlert ( source = "case importer" , domain = domain , message = message ) send_abnormal_usage_alert . delay ( alert )