Created
May 28, 2019 13:27
-
-
Save rmccullagh/efbc73526d3f24b3e2a93f9e011bbe34 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Api\Site\Progress; | |
use Illuminate\Support\Facades\Redis; | |
use Illuminate\Support\Facades\Log; | |
use App\Http\Api\Constants\AmezmoApi; | |
use App\Http\Api\BaseApiController; | |
use App\Http\Api\Site\Progress\Models\ProgressReport; | |
class SiteProgressController extends BaseApiController | |
{ | |
public function __construct() {} | |
public function report(ProgressReport $report) | |
{ | |
if ($report->step === 0) { | |
$package = ['percentage' => 100, 'message' => 'Failed']; | |
Log::error('got error signal from container instance engine'); | |
} else { | |
$package = ['percentage' => $report->step, 'message' => $report->message]; | |
} | |
Log::debug('progress', $package); | |
Redis::set(stubbedProgressKey() json_encode($package), 'EX', AmezmoApi::PROGRESS_MESSAGE_TTL); | |
return view(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment