

@task
def import_products_async(domain, file_ref_id):
    try:
        importer = SingleExcelImporter(import_products_async, file_ref_id)
    except UnknownFileRefException:
        return {
            'messages': {
                'errors': [_('Sorry, something went wrong! Please try again and report an issue if the problem persists')],
            },
        }
    results = import_products(domain, importer)
    importer.mark_complete()
    return {
        'messages': results,
    }

dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/products/tasks.py import_products_async/original