Hi
in OJs 2.3.5 when editor decides to record a decision, sometimes this decision inserts in db more than one time , for example 4 or 5 times, I can not understand why this happens , so I tried to add sleep(1) in order to prevent it and as I think this problem happens when the query has not executed completely, is this work right ?
for ($i = 1; $i <= $sectionEditorSubmission->getCurrentRound(); $i++) {
$editorDecisions = $sectionEditorSubmission->getDecisions($i);
if (is_array($editorDecisions)) {
foreach ($editorDecisions as $editorDecision) {
if ($editorDecision['editDecisionId'] == null) {//echo $i;die('**');
$this->update(
sprintf('INSERT INTO edit_decisions
(article_id, round, editor_id, decision, date_decided)
VALUES (?, ?, ?, ?, %s)',
$this->datetimeToDB($editorDecision['dateDecided'])),
array($sectionEditorSubmission->getArticleId(), $sectionEditorSubmission->getCurrentRound(), $editorDecision['editorId'], $editorDecision['decision'])
);sleep(1);
}
}
}
}