Skip to content

Commit

Permalink
Merge branch 'hotfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
jimyhuang committed Nov 7, 2024
2 parents fdf57b9 + edebf5b commit 4f63c00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CRM/Batch/BAO/Batch.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public static function cancelStuckBatch() {
if ($dao->data) {
$meta = unserialize($dao->data);
// after 4 hours without any progress, cancel it
if (is_array($meta) && empty($meta['processed'])) {
if (is_array($meta) && empty($meta['processed']) && !empty($dao->modified_date)) {
$lastSuccessTime = strtotime($dao->modified_date);
if (CRM_REQUEST_TIME - $lastSuccessTime > 3600 * self::EXPIRE_HOUR) {
CRM_Core_Error::debug_log_message("Canceled running batch id {$dao->id} due to zero progress over ".self::EXPIRE_HOUR." hours.");
Expand Down

0 comments on commit 4f63c00

Please sign in to comment.