cubicweb/server/sources/datafeed.py
branch3.25
changeset 12146 d540defa0591
parent 12144 f54286c1cef5
child 12148 79160d54662e
equal deleted inserted replaced
12145:752b94ed9748 12146:d540defa0591
   189         import_log = cnx.create_entity('CWDataImport', cw_import_of=self)
   189         import_log = cnx.create_entity('CWDataImport', cw_import_of=self)
   190         cnx.commit()  # commit the import log creation before starting the synchronize task
   190         cnx.commit()  # commit the import log creation before starting the synchronize task
   191 
   191 
   192         def _synchronize_source(repo, source_eid, import_log_eid):
   192         def _synchronize_source(repo, source_eid, import_log_eid):
   193             with repo.internal_cnx() as cnx:
   193             with repo.internal_cnx() as cnx:
   194                 source = repo.sources_by_eid[source_eid]
   194                 source = repo.source_by_eid(source_eid)
   195                 source._pull_data(cnx, force, raise_on_error, import_log_eid=import_log_eid)
   195                 source._pull_data(cnx, force, raise_on_error, import_log_eid=import_log_eid)
   196 
   196 
   197         sync = partial(_synchronize_source, cnx.repo, self.eid, import_log.eid)
   197         sync = partial(_synchronize_source, cnx.repo, self.eid, import_log.eid)
   198         cnx.repo.threaded_task(sync)
   198         cnx.repo.threaded_task(sync)
   199         return {'import_log_eid': import_log.eid}
   199         return {'import_log_eid': import_log.eid}