equal
deleted
inserted
replaced
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} |