Call job::fail() so jobs are put onto the fail queue
This commit is contained in:
parent
28fdd0fcab
commit
3b207dbf7f
@ -46,12 +46,12 @@ class CatalogDelete implements ShouldQueue
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle(): void
|
||||||
{
|
{
|
||||||
if (! $this->o->remove) {
|
if (! $this->o->remove) {
|
||||||
Log::warning(sprintf('%s: NOT Deleting [%s] not marked for deletion',__METHOD__,$this->o->file_name_rel(FALSE)));
|
Log::warning(sprintf('%s: NOT Deleting [%s] not marked for deletion',__METHOD__,$this->o->file_name_rel(FALSE)));
|
||||||
|
|
||||||
exit;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove tags;
|
// Remove tags;
|
||||||
@ -63,10 +63,12 @@ class CatalogDelete implements ShouldQueue
|
|||||||
$this->o->people()->detach();
|
$this->o->people()->detach();
|
||||||
|
|
||||||
// Make sure our parent is writable
|
// Make sure our parent is writable
|
||||||
if (! $this->o->isParentWritable(dirname($this->o->file_name_rel(TRUE)))) {
|
if (! $this->o->isParentWritable($x=dirname($this->o->file_name_rel(TRUE)))) {
|
||||||
Log::warning(sprintf('%s: NOT Deleting [%s] parent directory not writable',__METHOD__,$this->o->file_name(FALSE)));
|
Log::warning(sprintf('%s: NOT Deleting [%s] parent directory not writable',__METHOD__,$this->o->file_name(FALSE)));
|
||||||
|
|
||||||
$this->fail();
|
$this->fail('Parent not writable:'.$x);
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Perform delete
|
// Perform delete
|
||||||
|
@ -49,7 +49,7 @@ class CatalogMove implements ShouldQueue,ShouldBeUnique
|
|||||||
* @return void
|
* @return void
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle(): void
|
||||||
{
|
{
|
||||||
$from = $this->o->file_name_rel();
|
$from = $this->o->file_name_rel();
|
||||||
$to = $this->o->file_name_rel(FALSE);
|
$to = $this->o->file_name_rel(FALSE);
|
||||||
|
@ -49,7 +49,7 @@ class CatalogScan implements ShouldQueue,ShouldBeUnique
|
|||||||
* @return void
|
* @return void
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle(): void
|
||||||
{
|
{
|
||||||
Log::info(sprintf('Scanning [%s] (%d)',$this->o->file_name(FALSE),$this->o->id));
|
Log::info(sprintf('Scanning [%s] (%d)',$this->o->file_name(FALSE),$this->o->id));
|
||||||
|
|
||||||
@ -69,11 +69,13 @@ class CatalogScan implements ShouldQueue,ShouldBeUnique
|
|||||||
$this->o->getObjectOriginal('height'),
|
$this->o->getObjectOriginal('height'),
|
||||||
$this->o->file_name(FALSE)));
|
$this->o->file_name(FALSE)));
|
||||||
|
|
||||||
throw new \Exception(sprintf('Dimensions [%s] (%s x %s) mismatch for [%s]',
|
$this->fail(new \Exception(sprintf('Dimensions [%s] (%s x %s) mismatch for [%s]',
|
||||||
$this->o->dimensions,
|
$this->o->dimensions,
|
||||||
$this->o->getObjectOriginal('width'),
|
$this->o->getObjectOriginal('width'),
|
||||||
$this->o->getObjectOriginal('height'),
|
$this->o->getObjectOriginal('height'),
|
||||||
$this->o->file_name(FALSE)));
|
$this->o->file_name(FALSE))));
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
} elseif ($this->o->file_signature) {
|
} elseif ($this->o->file_signature) {
|
||||||
@ -82,10 +84,12 @@ class CatalogScan implements ShouldQueue,ShouldBeUnique
|
|||||||
$this->o->file_signature,
|
$this->o->file_signature,
|
||||||
$this->o->file_name(FALSE)));
|
$this->o->file_name(FALSE)));
|
||||||
|
|
||||||
throw new \Exception(sprintf('File Signature [%s] doesnt match [%s] for [%s]',
|
$this->fail(new \Exception(sprintf('File Signature [%s] doesnt match [%s] for [%s]',
|
||||||
$x,
|
$x,
|
||||||
$this->o->file_signature,
|
$this->o->file_signature,
|
||||||
$this->o->file_name(FALSE)));
|
$this->o->file_name(FALSE))));
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->o->init();
|
$this->o->init();
|
||||||
@ -120,12 +124,15 @@ class CatalogScan implements ShouldQueue,ShouldBeUnique
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If the file signature changed, abort the update.
|
// If the file signature changed, abort the update.
|
||||||
if ($this->o->getOriginal('file_signature') && $this->o->wasChanged('file_signature'))
|
if ($this->o->getOriginal('file_signature') && $this->o->wasChanged('file_signature')) {
|
||||||
throw new \Exception(sprintf('File Signature Changed for [%s] DB: [%s], File: [%s]?',
|
$this->fail(new \Exception(sprintf('File Signature Changed for [%s] DB: [%s], File: [%s]?',
|
||||||
$this->o->file_name(),
|
$this->o->file_name(),
|
||||||
$this->o->file_signature,
|
$this->o->file_signature,
|
||||||
$this->o->getOriginal('file_signature'),
|
$this->o->getOriginal('file_signature'),
|
||||||
));
|
)));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$this->o->save();
|
$this->o->save();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user