invenio_migrator/cli.py
def _loadrecord(record_dump, source_type, eager=False):
    """Load a single record into the database.

    :param record_dump: Record dump.
    :type record_dump: dict
    :param source_type: 'json' or 'marcxml'
    :param eager: If ``True`` execute the task synchronously.
    """
    if eager:
        import_record.s(record_dump, source_type=source_type).apply(throw=True)
    elif current_migrator.records_post_task:
        chain(
            import_record.s(record_dump, source_type=source_type),
            current_migrator.records_post_task.s()
        )()
    else:
        import_record.delay(record_dump, source_type=source_type)
def _loadrecord(record_dump, source_type, eager=False):
    """Load a single record into the database.

    :param record_dump: Record dump.
    :type record_dump: dict
    :param source_type: 'json' or 'marcxml'
    :param eager: If ``True`` execute the task synchronously.
    """
    if eager:
        import_record.s(record_dump, source_type=source_type).apply(throw=True)
    elif current_migrator.records_post_task:
        chain(
            import_record.s(record_dump, source_type=source_type),
            current_migrator.records_post_task.s()
        )()
    else:
        import_record.delay(record_dump, source_type=source_type)
Load a single record into the database.

    :param record_dump: Record dump.
    :type record_dump: dict
    :param source_type: 'json' or 'marcxml'
    :param eager: If ``True`` execute the task synchronously.