Skip to content

Commit

Permalink
Merge pull request #139 from silinternational/develop
Browse files Browse the repository at this point in the history
Release 4.3.1 If syncAll() throws an exception, make sure it gets logged and emailed
  • Loading branch information
Baggerone authored Nov 14, 2022
2 parents 6cdc05a + ce23a9f commit 35eb8d0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
22 changes: 22 additions & 0 deletions application/common/sync/Synchronizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,28 @@ public static function isValidSafetyCutoff($value)
return is_numeric($value) && ($value >= 0.0);
}


/**
* Do a full synchronization, requesting all users from the ID Store and
* updating all records in the ID Broker.
*
* If there is an exception, send out an email about it.
*/
public function syncAllNotifyException()
{
try {
$this->syncAll();
} catch (Exception $e) {
$message = sprintf(
'There was an error with the sync process. Code: %s, Message: %s',
$e->getCode(),
$e->getMessage(),
);
$this->logger->error($message);
}
}


/**
* Do a full synchronization, requesting all users from the ID Store and
* updating all records in the ID Broker.
Expand Down
2 changes: 1 addition & 1 deletion application/console/controllers/BatchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class BatchController extends Controller
public function actionFull()
{
$synchronizer = $this->getSynchronizer();
$synchronizer->syncAll();
$synchronizer->syncAllNotifyException();
}

/**
Expand Down

0 comments on commit 35eb8d0

Please sign in to comment.