Skip to content

Commit

Permalink
Define $key outside of the try/catch statement
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean committed Sep 27, 2024
1 parent 6db65ff commit eac32f6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Marketplace/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,12 @@ public function get($endpoint, $params = [])
{
$lock = $this->lock(static::LOCK_KEY, 10);

$endpoint = collect([$this->domain, self::API_PREFIX, $endpoint])->implode('/');
$key = 'marketplace-'.md5($endpoint.json_encode($params));

try {
$lock->block(5);

$endpoint = collect([$this->domain, self::API_PREFIX, $endpoint])->implode('/');

$key = 'marketplace-'.md5($endpoint.json_encode($params));

return $this->cache()->rememberWithExpiration($key, function () use ($endpoint, $params) {
$response = Guzzle::request('GET', $endpoint, [
'verify' => $this->verifySsl,
Expand Down

0 comments on commit eac32f6

Please sign in to comment.