diff --git a/src/jobs/RevalidateAssetJob.php b/src/jobs/RevalidateAssetJob.php index 0cb9e0f..9d02899 100644 --- a/src/jobs/RevalidateAssetJob.php +++ b/src/jobs/RevalidateAssetJob.php @@ -22,8 +22,6 @@ public function execute($queue): void if (empty($doKey)) return; - sleep(5); - $client = Craft::createGuzzleClient(); $assets = Asset::find()->id($this->assetIds)->all(); @@ -36,6 +34,7 @@ public function execute($queue): void ->get('https://api.digitalocean.com/v2/cdn/endpoints?per_page=200', ['headers' => $headers]) ->getBody() ->getContents(); + sleep(1); $allSpaces = json_decode($response)->endpoints; $spaceFiles = []; @@ -71,6 +70,7 @@ public function execute($queue): void ]); $queue->setProgress(++$i / $total * 100); + sleep(1); } } diff --git a/src/services/Revalidator.php b/src/services/Revalidator.php index 7ca008a..13dbfae 100644 --- a/src/services/Revalidator.php +++ b/src/services/Revalidator.php @@ -235,11 +235,11 @@ private function pushRelatedElements(Element $element, array $exclude = null): a ]) ->andWhere(['not in', 'sourceId', $exclude ?? []]) ->andWhere(['not in', 'targetId', $exclude ?? []]) + ->andWhere(['not in', 'elements.type', ['craft\\elements\\Asset']]) ->andWhere([ 'revisionId' => null, 'draftId' => null, ]) - ->andWhere(['!=', 'elements.type', 'Asset']) ->groupBy('elements.type') ->pairs();