mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-15 07:45:54 +01:00
Fixed issue where an exception is raised if KEYS() finds no matches and returns null (#733)
This commit is contained in:
parent
b9fcc04647
commit
ec5a804576
@ -265,14 +265,17 @@ end;
|
|||||||
|
|
||||||
procedure TMVCCacheController.DeleteCacheKey(const AKey: string = '');
|
procedure TMVCCacheController.DeleteCacheKey(const AKey: string = '');
|
||||||
var
|
var
|
||||||
AKeys: TArray<string>;
|
AKeys: TRedisArray;
|
||||||
ARedis: IRedisClient;
|
ARedis: IRedisClient;
|
||||||
begin
|
begin
|
||||||
ARedis := RedisClient;
|
ARedis := RedisClient;
|
||||||
if AKey <> '' then
|
if AKey <> '' then
|
||||||
begin
|
begin
|
||||||
AKeys := ARedis.KEYS(AKey).ToArray;
|
AKeys := ARedis.KEYS(AKey);
|
||||||
ARedis.DEL(AKeys);
|
if AKeys.HasValue then
|
||||||
|
begin
|
||||||
|
ARedis.DEL(AKeys.ToArray);
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user