Skip to content

Instantly share code, notes, and snippets.

@rmccullagh
Created May 28, 2019 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rmccullagh/efbc73526d3f24b3e2a93f9e011bbe34 to your computer and use it in GitHub Desktop.
Save rmccullagh/efbc73526d3f24b3e2a93f9e011bbe34 to your computer and use it in GitHub Desktop.
<?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