Skip to content

Commit 0807344

Browse files
authored
Refactor time handling using InteractsWithTime trait (#49601)
1 parent 1f252ac commit 0807344

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Illuminate/Cache/DynamoDbStore.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public function add($key, $value, $seconds)
285285
],
286286
'ExpressionAttributeValues' => [
287287
':now' => [
288-
'N' => (string) Carbon::now()->getTimestamp(),
288+
'N' => (string) $this->currentTime(),
289289
],
290290
],
291291
]);
@@ -326,7 +326,7 @@ public function increment($key, $value = 1)
326326
],
327327
'ExpressionAttributeValues' => [
328328
':now' => [
329-
'N' => (string) Carbon::now()->getTimestamp(),
329+
'N' => (string) $this->currentTime(),
330330
],
331331
':amount' => [
332332
'N' => (string) $value,
@@ -371,7 +371,7 @@ public function decrement($key, $value = 1)
371371
],
372372
'ExpressionAttributeValues' => [
373373
':now' => [
374-
'N' => (string) Carbon::now()->getTimestamp(),
374+
'N' => (string) $this->currentTime(),
375375
],
376376
':amount' => [
377377
'N' => (string) $value,
@@ -469,7 +469,7 @@ protected function toTimestamp($seconds)
469469
{
470470
return $seconds > 0
471471
? $this->availableAt($seconds)
472-
: Carbon::now()->getTimestamp();
472+
: $this->currentTime();
473473
}
474474

475475
/**

0 commit comments

Comments
 (0)