Skip to content

Commit

Permalink
Make shop domain safer
Browse files Browse the repository at this point in the history
  • Loading branch information
xHeaven committed Nov 24, 2024
1 parent cfe25f1 commit 557af82
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Services/RateLimitService.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Redis;
use Illuminate\Support\Sleep;
use Illuminate\Support\Str;

class RateLimitService
{
private string $redisKey;

public function __construct(private readonly string $shopDomain)
{
$this->redisKey = "shopify_graphql_rate_limit_{$this->shopDomain}";
$shopDomainKey = Str::replace(['.'], '_', $this->shopDomain);
$this->redisKey = "shopify_graphql_rate_limit:{$shopDomainKey}";
}

public function getRateLimitInfo(): array
Expand Down

0 comments on commit 557af82

Please sign in to comment.