Move ResizeJob to Jobs dir
continuous-integration/drone/push Build encountered an error
Details
continuous-integration/drone/push Build encountered an error
Details
This commit is contained in:
parent
54fd872452
commit
fe794ab094
|
@ -5,7 +5,7 @@ namespace Aweos\Resizer;
|
||||||
use Aweos\Resizer\Classes\CacheManager;
|
use Aweos\Resizer\Classes\CacheManager;
|
||||||
use Aweos\Resizer\Classes\FileObserver;
|
use Aweos\Resizer\Classes\FileObserver;
|
||||||
use Aweos\Resizer\Classes\ImageResizer;
|
use Aweos\Resizer\Classes\ImageResizer;
|
||||||
use Aweos\Resizer\Classes\ResizeJob;
|
use Aweos\Resizer\Jobs\ResizeJob;
|
||||||
use Aweos\Resizer\Console\ResizeMake;
|
use Aweos\Resizer\Console\ResizeMake;
|
||||||
use Aweos\Resizer\Console\ResizePurge;
|
use Aweos\Resizer\Console\ResizePurge;
|
||||||
use Aweos\Resizer\Jobs\DeleteJob;
|
use Aweos\Resizer\Jobs\DeleteJob;
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace Aweos\Resizer\Classes;
|
|
||||||
|
|
||||||
use Aweos\Resizer\Classes\CacheManager;
|
|
||||||
use Aweos\Resizer\Lib\MediaPath;
|
|
||||||
use Aweos\Resizer\Lib\TempMediaPath;
|
|
||||||
use Log;
|
|
||||||
use Throwable;
|
|
||||||
|
|
||||||
class ResizeJob
|
|
||||||
{
|
|
||||||
|
|
||||||
public function fire($job, $params)
|
|
||||||
{
|
|
||||||
list($file) = $params;
|
|
||||||
$media = new TempMediaPath($file);
|
|
||||||
app(ImageResizer::class)->generate($media, $params['update'] ?? false);
|
|
||||||
app(CacheManager::class)->delete($media);
|
|
||||||
unset ($media);
|
|
||||||
|
|
||||||
$job->delete();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function failed($data, Throwable $e)
|
|
||||||
{
|
|
||||||
Log::error("Resizing of image failed", [
|
|
||||||
'message' => $e->getMessage(),
|
|
||||||
'exception' => $e,
|
|
||||||
'data' => $data,
|
|
||||||
]);
|
|
||||||
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php namespace Aweos\Resizer\Console;
|
<?php namespace Aweos\Resizer\Console;
|
||||||
|
|
||||||
use Aweos\Resizer\Classes\CacheManager;
|
use Aweos\Resizer\Classes\CacheManager;
|
||||||
use Aweos\Resizer\Classes\ResizeJob;
|
use Aweos\Resizer\Jobs\ResizeJob;
|
||||||
use Aweos\Resizer\Models\Setting;
|
use Aweos\Resizer\Models\Setting;
|
||||||
use Exception;
|
use Exception;
|
||||||
use GuzzleHttp\Client;
|
use GuzzleHttp\Client;
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
namespace Aweos\Resizer\Jobs;
|
namespace Aweos\Resizer\Jobs;
|
||||||
|
|
||||||
use Aweos\Resizer\Classes\CacheManager;
|
use Aweos\Resizer\Classes\CacheManager;
|
||||||
|
use Aweos\Resizer\Classes\ImageResizer;
|
||||||
use Aweos\Resizer\Lib\MediaPath;
|
use Aweos\Resizer\Lib\MediaPath;
|
||||||
use Aweos\Resizer\Lib\TempMediaPath;
|
use Aweos\Resizer\Lib\TempMediaPath;
|
||||||
use Log;
|
use Log;
|
||||||
|
|
Loading…
Reference in New Issue