Move ResizeJob to Jobs dir
continuous-integration/drone/push Build encountered an error Details

This commit is contained in:
philipp lang 2022-02-16 03:15:07 +01:00
parent 54fd872452
commit fe794ab094
4 changed files with 3 additions and 37 deletions

View File

@ -5,7 +5,7 @@ namespace Aweos\Resizer;
use Aweos\Resizer\Classes\CacheManager;
use Aweos\Resizer\Classes\FileObserver;
use Aweos\Resizer\Classes\ImageResizer;
use Aweos\Resizer\Classes\ResizeJob;
use Aweos\Resizer\Jobs\ResizeJob;
use Aweos\Resizer\Console\ResizeMake;
use Aweos\Resizer\Console\ResizePurge;
use Aweos\Resizer\Jobs\DeleteJob;

View File

@ -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;
}
}

View File

@ -1,7 +1,7 @@
<?php namespace Aweos\Resizer\Console;
use Aweos\Resizer\Classes\CacheManager;
use Aweos\Resizer\Classes\ResizeJob;
use Aweos\Resizer\Jobs\ResizeJob;
use Aweos\Resizer\Models\Setting;
use Exception;
use GuzzleHttp\Client;

View File

@ -3,6 +3,7 @@
namespace Aweos\Resizer\Jobs;
use Aweos\Resizer\Classes\CacheManager;
use Aweos\Resizer\Classes\ImageResizer;
use Aweos\Resizer\Lib\MediaPath;
use Aweos\Resizer\Lib\TempMediaPath;
use Log;