Skip to content

Commit b66d0c5

Browse files
fix bug when reset time is in the past
1 parent 1dc4158 commit b66d0c5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Teamleader.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,9 @@ public function ensureRateLimitingIsNotExceeded(): void
270270
$seconds = Carbon::createFromFormat('Y-m-d\TH:i:sT', $this->rateLimitReset, 'UTC')->diffInSeconds();
271271
$seconds++;
272272

273-
sleep($seconds);
273+
if ($seconds > 0) {
274+
sleep($seconds);
275+
}
274276
}
275277
}
276278

0 commit comments

Comments
 (0)