feat: try sync calories
This commit is contained in:
@@ -79,6 +79,20 @@ class StravaClient
|
||||
->json();
|
||||
}
|
||||
|
||||
public function activity(StravaConnection $connection, int|string $activityId): array
|
||||
{
|
||||
return Http::baseUrl('https://www.strava.com/api/v3')
|
||||
->withToken($this->accessToken($connection))
|
||||
->timeout(10)
|
||||
->connectTimeout(3)
|
||||
->retry([100, 500, 1000])
|
||||
->get("/activities/{$activityId}", [
|
||||
'include_all_efforts' => false,
|
||||
])
|
||||
->throw()
|
||||
->json();
|
||||
}
|
||||
|
||||
private function accessToken(StravaConnection $connection): string
|
||||
{
|
||||
if (! $connection->expires_at || $connection->expires_at->lte(now()->addMinutes(5))) {
|
||||
|
||||
Reference in New Issue
Block a user