Skip to content

Commit

Permalink
use custom queue
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Oct 1, 2015
1 parent 3e889ef commit 0f60cc8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

All Notable changes to `laravel-medialibrary` will be documented in this file

##3.3.1
- Fixed a bug where conversions would always be performed on the default queue

##3.3.0
- Added `hasCustomProperty`- and `getCustomProperty`-convenience-methods

Expand Down
21 changes: 20 additions & 1 deletion src/FileManipulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function createDerivedFiles(Media $media)
$queuedConversions = $profileCollection->getQueuedConversions($media->collection_name);

if (count($queuedConversions)) {
$this->dispatch(new PerformConversions($queuedConversions, $media));
$this->dispatchQueuedConversions($media, $queuedConversions);
}
}

Expand Down Expand Up @@ -128,4 +128,23 @@ protected function convertToImage($pdfFile)

return $imageFile;
}

/**
* Dispatch the given conversions.
*
* @param Media $media
* @param $queuedConversions
*/
protected function dispatchQueuedConversions(Media $media, $queuedConversions)
{
$job = new PerformConversions($queuedConversions, $media);

$customQueue = config('laravel-medialibrary.queue_name');

if ($customQueue != '') {
$job->onQueue($customQueue);
}

$this->dispatch($job);
}
}
2 changes: 1 addition & 1 deletion src/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function getExtensionAttribute()
}

/**
/**
/**
* @return string
*/
public function getHumanReadableSizeAttribute()
Expand Down

0 comments on commit 0f60cc8

Please sign in to comment.