. * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ namespace Espo\Classes\Jobs; use Espo\Core\Mail\Account\PersonalAccount\Service; use Espo\Core\Job\Job; use Espo\Core\Job\Job\Data; use RuntimeException; use Throwable; class CheckEmailAccounts implements Job { public function __construct(private Service $service) {} public function run(Data $data): void { $targetId = $data->getTargetId(); if (!$targetId) { throw new RuntimeException("No target."); } try { $this->service->fetch($targetId); } catch (Throwable $e) { throw new RuntimeException("CheckEmailAccounts job failed, $targetId; {$e->getMessage()}", 0, $e); } } }