Skip to content

Commit

Permalink
fix: cache for just one min
Browse files Browse the repository at this point in the history
  • Loading branch information
brokeyourbike committed Nov 23, 2023
1 parent 3cecdb1 commit 6bc22ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Client.php
Expand Up @@ -73,7 +73,7 @@ public function getToken(): string
$this->cache->set(
$this->authTokenCacheKey(),
$response->accessToken,
intval($response->expiresIn / 2)
$response->expiresIn < 60 ? 0 : 60
);

return $response->accessToken;
Expand Down
3 changes: 1 addition & 2 deletions tests/GetTokenTest.php
Expand Up @@ -59,7 +59,7 @@ public function it_can_cache_and_return_auth_token()
->with(
$api->authTokenCacheKey(),
$this->tokenValue,
600000 / 2
60
);
}

Expand Down Expand Up @@ -91,5 +91,4 @@ public function it_can_return_cached_value()

$this->assertSame($this->tokenValue, $requestResult);
}

}

0 comments on commit 6bc22ad

Please sign in to comment.