Make NodaImportLogger more resilient, prevent error in case of duplicate import names
This commit is contained in:
parent
bf22f5541d
commit
546c17031a
@ -32,8 +32,12 @@ final class NodaImportLogger {
|
||||
$logStmt = $mysqli_noda->do_prepare("INSERT INTO `persinst_logged_imports`
|
||||
(`instance`, `institution_id`, `input_string`, `persinst_id`)
|
||||
VALUES (?, ?, ?, ?)");
|
||||
$logStmt->bind_param("sisi", $instance, $institution_id, $loggedName, $persinst_id);
|
||||
$logStmt->execute();
|
||||
try {
|
||||
$logStmt->bind_param("sisi", $instance, $institution_id, $loggedName, $persinst_id);
|
||||
$logStmt->execute();
|
||||
}
|
||||
catch (MDMysqliDuplicateKeysError $e) {
|
||||
}
|
||||
$logStmt->close();
|
||||
|
||||
}
|
||||
@ -54,8 +58,12 @@ final class NodaImportLogger {
|
||||
$logStmt = $mysqli_noda->do_prepare("INSERT INTO `orte_logged_imports`
|
||||
(`instance`, `institution_id`, `input_string`, `ort_id`)
|
||||
VALUES (?, ?, ?, ?)");
|
||||
$logStmt->bind_param("sisi", $instance, $institution_id, $name, $ort_id);
|
||||
$logStmt->execute();
|
||||
try {
|
||||
$logStmt->bind_param("sisi", $instance, $institution_id, $name, $ort_id);
|
||||
$logStmt->execute();
|
||||
}
|
||||
catch (MDMysqliDuplicateKeysError $e) {
|
||||
}
|
||||
$logStmt->close();
|
||||
|
||||
}
|
||||
@ -76,8 +84,12 @@ final class NodaImportLogger {
|
||||
$logStmt = $mysqli_noda->do_prepare("INSERT INTO `zeiten_logged_imports`
|
||||
(`instance`, `institution_id`, `input_string`, `zeit_id`)
|
||||
VALUES (?, ?, ?, ?)");
|
||||
$logStmt->bind_param("sisi", $instance, $institution_id, $name, $zeit_id);
|
||||
$logStmt->execute();
|
||||
try {
|
||||
$logStmt->bind_param("sisi", $instance, $institution_id, $name, $zeit_id);
|
||||
$logStmt->execute();
|
||||
}
|
||||
catch (MDMysqliDuplicateKeysError $e) {
|
||||
}
|
||||
$logStmt->close();
|
||||
|
||||
}
|
||||
@ -98,8 +110,12 @@ final class NodaImportLogger {
|
||||
$logStmt = $mysqli_noda->do_prepare("INSERT INTO `tag_logged_imports`
|
||||
(`instance`, `institution_id`, `input_string`, `tag_id`)
|
||||
VALUES (?, ?, ?, ?)");
|
||||
$logStmt->bind_param("sisi", $instance, $institution_id, $name, $tag_id);
|
||||
$logStmt->execute();
|
||||
try {
|
||||
$logStmt->bind_param("sisi", $instance, $institution_id, $name, $tag_id);
|
||||
$logStmt->execute();
|
||||
}
|
||||
catch (MDMysqliDuplicateKeysError $e) {
|
||||
}
|
||||
$logStmt->close();
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user