30 lines
565 B
PHP
30 lines
565 B
PHP
<?php
|
|
|
|
namespace Aweos\Resizer\Classes;
|
|
|
|
use Aweos\Resizer\Lib\MediaPath;
|
|
use Log;
|
|
use Throwable;
|
|
|
|
class ResizeJob
|
|
{
|
|
|
|
public function fire($job, $params)
|
|
{
|
|
list($file) = $params;
|
|
app(ImageResizer::class)->generate(new MediaPath($file), $params['update'] ?? false);
|
|
$job->delete();
|
|
}
|
|
|
|
public function failed($data, Throwable $e)
|
|
{
|
|
Log::error("Resizing of image failed", [
|
|
'message' => $e->getMessage(),
|
|
'exception' => $e,
|
|
'data' => $data,
|
|
]);
|
|
|
|
throw $e;
|
|
}
|
|
}
|