2nd try to speed up importer

这个提交包含在:
int2001 2023-12-17 09:01:09 +00:00
父节点 6d7df1a2d3
当前提交 412e74f027
找不到此签名对应的密钥
GPG 密钥 ID: DFB1C13CD2DB037B
共有 2 个文件被更改,包括 19 次插入5 次删除

查看文件

@ -195,18 +195,22 @@ class adif extends CI_Controller {
$this->adif_parser->initialize();
$custom_errors = "";
$alladif=[];
while($record = $this->adif_parser->get_record())
{
if(count($record) == 0) {
break;
};
$one_error = $this->logbook_model->import($record, $this->input->post('station_profile'), $this->input->post('skipDuplicate'), $this->input->post('markClublog'),$this->input->post('markLotw'), $this->input->post('dxccAdif'), $this->input->post('markQrz'), $this->input->post('markHrd'), true, $this->input->post('operatorName'), false, $this->input->post('skipStationCheck'));
if ($one_error != '') {
$custom_errors.=$one_error."<br/>";
}
array_push($alladif,$record);
// $one_error = $this->logbook_model->import($record, $this->input->post('station_profile'), $this->input->post('skipDuplicate'), $this->input->post('markClublog'),$this->input->post('markLotw'), $this->input->post('dxccAdif'), $this->input->post('markQrz'), $this->input->post('markHrd'), true, $this->input->post('operatorName'), false, $this->input->post('skipStationCheck'));
// if ($one_error != '') {
// $custom_errors.=$one_error."<br/>";
// }
};
unlink('./uploads/'.$data['upload_data']['file_name']);
$record='';
$data='';
$custom_errors = $this->logbook_model->import_bulk($alladif, $this->input->post('station_profile'), $this->input->post('skipDuplicate'), $this->input->post('markClublog'),$this->input->post('markLotw'), $this->input->post('dxccAdif'), $this->input->post('markQrz'), $this->input->post('markHrd'), true, $this->input->post('operatorName'), false, $this->input->post('skipStationCheck'));
} else {
$custom_errors='Station Profile not valid for User';
}

查看文件

@ -3077,6 +3077,16 @@ function lotw_last_qsl_date($user_id) {
return '1900-01-01 00:00:00.000';
}
function import_bulk($records, $station_id = "0", $skipDuplicate = false, $markClublog = false, $markLotw = false, $dxccAdif = false, $markQrz = false, $markHrd = false,$skipexport = false, $operatorName = false, $apicall = false, $skipStationCheck = false) {
$custom_errors='';
foreach ($records as $record) {
$one_error = $this->logbook_model->import($record, $station_id, $skipDuplicate, $markClublog, $markLotw,$dxccadif, $markQrz, $markHrd, $skipexport, $operatorName, $apicall, $skipStationCheck);
if ($one_error != '') {
$custom_errors.=$one_error."<br/>";
}
}
return $custom_errors;
}
/*
* $skipDuplicate - used in ADIF import to skip duplicate checking when importing QSOs
* $markLoTW - used in ADIF import to mark QSOs as exported to LoTW when importing QSOs