Skip to content

Commit 1c0830e

Browse files
committed
Reduce redundant commands execution
1 parent 13db264 commit 1c0830e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/app/models/key-models/abstractkey.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class KeyModel : public ValueEditor::Model {
125125
auto self = ValueEditor::Model::sharedFromThis().toWeakRef();
126126

127127
m_connection->cmd(
128-
cmdParts, m_notifier.data(), m_dbIndex,
128+
cmdParts, m_notifier.data(), -1,
129129
[this, callback, rowStart, self](RedisClient::Response r) {
130130
if (!r.isValidScanResponse()) {
131131
callback(QCoreApplication::translate(
@@ -242,7 +242,7 @@ class KeyModel : public ValueEditor::Model {
242242

243243
return callback(QString(), r.value().toList());
244244
},
245-
m_dbIndex);
245+
-1);
246246
} catch (const RedisClient::Connection::Exception& e) {
247247
callback(
248248
QCoreApplication::translate("RDM", "Cannot load rows for key %1: %2")
@@ -284,7 +284,7 @@ class KeyModel : public ValueEditor::Model {
284284
RedisClient::Response::Type expectedType =
285285
RedisClient::Response::Type::Unknown) {
286286
m_connection->cmd(
287-
cmd, m_notifier.data(), m_dbIndex,
287+
cmd, m_notifier.data(), -1,
288288
[c, handler, expectedType](RedisClient::Response r) {
289289
if (expectedType != RedisClient::Response::Type::Unknown &&
290290
r.type() != expectedType) {

src/app/models/key-models/keyfactory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void KeyFactory::loadKey(QSharedPointer<RedisClient::Connection> connection, QBy
6565
callback(result, msg.arg(printableString(keyFullPath)).arg(err));
6666
};
6767

68-
connection->cmd({"ttl", keyFullPath}, this, dbIndex, parseTtl,
68+
connection->cmd({"ttl", keyFullPath}, this, -1, parseTtl,
6969
processTtlError);
7070
};
7171

0 commit comments

Comments
 (0)