Skip to content

Commit 1520a0a

Browse files
committed
ottimizzate update e insert
1 parent 9993617 commit 1520a0a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Helpers/SuperCacheInvalidationHelper.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
use Illuminate\Support\Facades\DB;
66
use Illuminate\Support\Facades\Log;
77
use Illuminate\Support\Facades\Redis;
8-
use \Illuminate\Support\Carbon;
8+
use Illuminate\Support\Carbon;
9+
910
class SuperCacheInvalidationHelper
1011
{
1112
/**
@@ -169,6 +170,7 @@ public function getCacheInvalidationTimestampsPartitionName(Carbon $event_time):
169170
}
170171
}
171172
}
173+
172174
return '';
173175
}
174176

@@ -180,8 +182,8 @@ public function getCacheInvalidationEventsProcessedPartitionName(int $shardId, i
180182
$eventTime = Carbon::parse($event_time);
181183
$partitionValueId = ($eventTime->year * 10000) + ($eventTime->weekOfYear * 100) + ($priorityId * $shards) + $shardId;
182184
// Partitions for processed events
183-
for ($year = $eventTime->year; $year <= ($eventTime->year+1); $year++) {
184-
for ($week = $eventTime->weekOfYear; $week <= $eventTime->weekOfYear+1; $week++) {
185+
for ($year = $eventTime->year; $year <= ($eventTime->year + 1); $year++) {
186+
for ($week = $eventTime->weekOfYear; $week <= $eventTime->weekOfYear + 1; $week++) {
185187
foreach ($priorities as $priority) {
186188
for ($shard = 0; $shard < $shards; $shard++) {
187189
$partitionKey = ($year * 10000) + ($week * 100) + ($priority * $shards) + $shard;

0 commit comments

Comments
 (0)