Skip to content

Commit

Permalink
Change Type to Float
Browse files Browse the repository at this point in the history
  • Loading branch information
syntafin authored Jul 7, 2024
1 parent 6d9f26e commit f770b6c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/DataEngines/DataEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ public function exists(string $key): bool;
*/
public function timeLeft(string $key): int;

public function setExpiration(string $key, int $time): bool;
public function setExpiration(string $key, float $time): bool;
}
2 changes: 1 addition & 1 deletion src/DataEngines/EloquentEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public function timeLeft(string $key): int
return $ttl <= 0 ? -1 : $ttl;
}

public function setExpiration(string $key, int $time): bool
public function setExpiration(string $key, float $time): bool
{
return $this->model->where(['primary_key' => $this->prefix.$key])
->where(function($q) {
Expand Down
2 changes: 1 addition & 1 deletion src/DataEngines/RedisEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function timeLeft(string $key): int
return $this->connection->ttl($this->prefix . $key);
}

public function setExpiration(string $key, int $time): bool
public function setExpiration(string $key, float $time): bool
{
return $this->connection->expire($this->prefix . $key, $time);
}
Expand Down

0 comments on commit f770b6c

Please sign in to comment.