Skip to content

Commit 41dfe82

Browse files
committed
Remove Custom Redis Cache
1 parent 38e76b9 commit 41dfe82

File tree

2 files changed

+5
-85
lines changed

2 files changed

+5
-85
lines changed

src/Cache/RedisTaggedCache.php

Lines changed: 0 additions & 80 deletions
This file was deleted.

src/ChunkPayloadProcessor.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44

55
use Illuminate\Support\Arr;
66
use Illuminate\Http\Request;
7-
use Illuminate\Cache\TagSet;
87
use Illuminate\Cache\RedisStore;
98
use Illuminate\Cache\RedisTagSet;
9+
use Illuminate\Cache\RedisTaggedCache;
1010
use Illuminate\Contracts\Cache\LockProvider;
11-
use CarroPublic\ChunkUpload\Cache\RedisTaggedCache;
1211

1312
class ChunkPayloadProcessor
1413
{
@@ -67,7 +66,8 @@ public function __construct(RedisStore $store, Request $request)
6766
public function process(Request $request)
6867
{
6968
// Preserve the current chunked data
70-
$this->store->put($this->chunkIndex, $this->chunkData);
69+
// TTL 5 mins
70+
$this->store->put($this->chunkIndex, $this->chunkData, 5 * 60);
7171

7272
if ($this->hasCollectedAllChunks()) {
7373
/** @var LockProvider $redisStore */
@@ -82,7 +82,7 @@ public function process(Request $request)
8282
}
8383

8484
// Return how many chunks we collected
85-
return count($this->store->foreverKeys());
85+
return $this->store->getTags()->entries()->count();
8686
}
8787

8888
/**
@@ -126,7 +126,7 @@ protected function restorePayloadFromChunks(Request $request)
126126
*/
127127
protected function hasCollectedAllChunks()
128128
{
129-
return $this->totalChunks === count($this->store->foreverKeys());
129+
return $this->totalChunks === $this->store->getTags()->entries()->count();
130130
}
131131

132132
/**

0 commit comments

Comments
 (0)