Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Commit

Permalink
Feature: fix frequency
Browse files Browse the repository at this point in the history
  • Loading branch information
hqy2000 committed Sep 29, 2018
1 parent 47c832c commit 4bebfa6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Service/CacheService.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,11 @@ public function canSend(string $ip, string $target) {
$this->client->expire($this->getIdentifierForCode($ip), 1800);

$current = (int)$this->client->get($this->getIdentifierForCode($target));
if($current > 3)
if($current > 1)
return false;
$current ++;
$this->client->set($this->getIdentifierForCode($target), $current);
$this->client->expire($this->getIdentifierForCode($target), 1800);

$this->client->expire($this->getIdentifierForCode($target), 60);
return true;
}

Expand Down

0 comments on commit 4bebfa6

Please sign in to comment.