Skip to content

Commit

Permalink
Merge pull request #4 from DivineOmega/analysis-z3Dpv4
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
DivineOmega authored Feb 15, 2018
2 parents 53b1c88 + 10ffcdd commit 5084839
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/PasswordExposedChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace DivineOmega\PasswordExposed;

use GuzzleHttp\Client;
use rapidweb\RWFileCachePSR6\CacheItemPool;
use GuzzleHttp\Psr7\Response;
use rapidweb\RWFileCachePSR6\CacheItemPool;

class PasswordExposedChecker
{
Expand Down Expand Up @@ -91,21 +91,20 @@ private function wait()
{
$startTime = time();

while(true) {

while (true) {
$lastRequestCacheItem = $this->cache->getItem('last_request');
if (!$lastRequestCacheItem->isHit() || $lastRequestCacheItem->get() < time() - self::TIME_BETWEEN_REQUESTS_SECONDS) {
$lastRequestCacheItem->set(time());
$this->cache->save($lastRequestCacheItem);

return true;
}

if ($startTime < time() - self::WAIT_TIMEOUT_SECONDS) {
return false;
}

sleep(1);

sleep(1);
}
}
}

0 comments on commit 5084839

Please sign in to comment.