Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't ignore feed options #1357

Merged
merged 1 commit into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/helpers/AssetHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ class AssetHelper
* @param $dstName
* @param int $chunkSize
* @param bool $returnbytes
* @param null|int $feedId
* @return bool|int
*/
public static function downloadFile($srcName, $dstName, $chunkSize = 1, $returnbytes = true)
public static function downloadFile($srcName, $dstName, $chunkSize = 1, $returnbytes = true, $feedId = null)
{
$assetDownloadCurl = Plugin::$plugin->getSettings()->assetDownloadCurl;
$assetDownloadCurl = Plugin::$plugin->service->getConfig('assetDownloadCurl', $feedId);

// Provide some legacy support
if ($assetDownloadCurl) {
Expand Down Expand Up @@ -106,7 +107,7 @@ public static function fetchRemoteImage(array $urls, $fieldInfo, $feed, $field =
Plugin::info('Fetching remote image `{i}` - `{j}`', ['i' => $url, 'j' => $filename]);

if (!$cachedImage) {
self::downloadFile($url, $fetchedImage);
self::downloadFile($url, $fetchedImage, 1, true, $feed['id']);
} else {
$fetchedImage = $cachedImage[0];
}
Expand Down
4 changes: 2 additions & 2 deletions src/queue/jobs/FeedImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ class FeedImport extends BaseJob implements RetryableJobInterface
*/
public function getTtr()
{
return Plugin::$plugin->getSettings()->queueTtr ?? Plugin::getInstance()->queue->ttr;
return Plugin::$plugin->service->getConfig('queueTtr', $this->feed->id) ?? Plugin::getInstance()->queue->ttr;
}

/**
* @inheritDoc
*/
public function canRetry($attempt, $error)
{
$attempts = Plugin::$plugin->getSettings()->queueMaxRetry ?? Plugin::getInstance()->queue->attempts;
$attempts = Plugin::$plugin->service->getConfig('queueMaxRetry', $this->feed->id) ?? Plugin::getInstance()->queue->attempts;
return $attempt < $attempts;
}

Expand Down
Loading