Skip to content

Commit

Permalink
Refactor time handling using InteractsWithTime trait (#49601)
Browse files Browse the repository at this point in the history
  • Loading branch information
xurshudyan committed Jan 6, 2024
1 parent 1f252ac commit 0807344
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Illuminate/Cache/DynamoDbStore.php
Expand Up @@ -285,7 +285,7 @@ public function add($key, $value, $seconds)
],
'ExpressionAttributeValues' => [
':now' => [
'N' => (string) Carbon::now()->getTimestamp(),
'N' => (string) $this->currentTime(),
],
],
]);
Expand Down Expand Up @@ -326,7 +326,7 @@ public function increment($key, $value = 1)
],
'ExpressionAttributeValues' => [
':now' => [
'N' => (string) Carbon::now()->getTimestamp(),
'N' => (string) $this->currentTime(),
],
':amount' => [
'N' => (string) $value,
Expand Down Expand Up @@ -371,7 +371,7 @@ public function decrement($key, $value = 1)
],
'ExpressionAttributeValues' => [
':now' => [
'N' => (string) Carbon::now()->getTimestamp(),
'N' => (string) $this->currentTime(),
],
':amount' => [
'N' => (string) $value,
Expand Down Expand Up @@ -469,7 +469,7 @@ protected function toTimestamp($seconds)
{
return $seconds > 0
? $this->availableAt($seconds)
: Carbon::now()->getTimestamp();
: $this->currentTime();
}

/**
Expand Down

0 comments on commit 0807344

Please sign in to comment.