From: Vincent Vanwaelscappel Date: Thu, 12 Dec 2024 17:34:05 +0000 (+0100) Subject: wait #7230 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=831c63c4ec9e52e28f6fde520e45f1b3a6cd50b0;p=fluidbook-toolbox.git wait #7230 @1 --- diff --git a/app/Services/ScormCloud.php b/app/Services/ScormCloud.php index e240c376e..73219cd44 100644 --- a/app/Services/ScormCloud.php +++ b/app/Services/ScormCloud.php @@ -37,7 +37,7 @@ class ScormCloud /** * @throws ApiException */ - public static function send($url, $courseId, $delete = true) + public static function send($url, $courseId, $delete = true, $attempts = 3) { $courseAPI = static::_getApi(); @@ -76,11 +76,18 @@ class ScormCloud } - if ($delete) { - static::deleteOldVersions($courseId); + try { + if ($delete) { + static::deleteOldVersions($courseId); + } + } catch (\Exception $e) { + if ($attempts >= 1) { + sleep(5); + return static::send($url, $courseId, $delete, $attempts - 1); + } } - return 'https://cloud.scorm.com/sc/user/Course?appId=' . self::getAppID() . '&courseId=' . $courseId; + return 'https://cloud.scorm.com/sc/user/Course?appId=' . self::getAppID() . '&courseId=' . $courseId . '&attempts=' . $attempts; } /**