Added GETDEL command to KeyPrefixProcessor (#1306)

* Added GETDEL command to KeyPrefixProcessor

* Added test coverage

* Codestyle fixes

* Added timeout after FT.CREATE call
This commit is contained in:
Vladyslav Vildanov
2023-06-08 11:32:05 +03:00
committed by GitHub
parent 3c322fc4e3
commit a711ef96e2
3 changed files with 11 additions and 0 deletions
@@ -186,6 +186,9 @@ class KeyPrefixProcessor implements ProcessorInterface
'XLEN' => $prefixFirst,
'XACK' => $prefixFirst,
'XTRIM' => $prefixFirst,
/* ---------------- Redis 6.2 ---------------- */
'GETDEL' => $prefixFirst,
];
}
@@ -973,6 +973,11 @@ class KeyPrefixProcessorTest extends PredisTestCase
['key', 'MAXLEN', 100],
['prefix:key', 'MAXLEN', 100],
],
/* ---------------- Redis 6.2 ---------------- */
['GETDEL',
['key'],
['prefix:key'],
],
];
}
}
@@ -113,6 +113,9 @@ class FTSEARCH_Test extends PredisCommandTestCase
$ftCreateResponse = $redis->ftcreate('idx_hash', $schema, $ftCreateArguments);
$this->assertEquals('OK', $ftCreateResponse);
// Timeout to make sure that index created before search performed.
usleep(2000);
$ftSearchArguments = new SearchArguments();
$ftSearchArguments->addReturn(1, 'should_return');