mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-22 16:55:59 +00:00
redis: set ttl
This commit is contained in:
@@ -181,6 +181,16 @@ module.exports = {
|
||||
return res.result || null;
|
||||
},
|
||||
|
||||
callMethod_meta: true,
|
||||
async callMethod({ conid, database, method, args }) {
|
||||
const opened = await this.ensureOpened(conid, database);
|
||||
const res = await this.sendRequest(opened, { msgtype: 'callMethod', method, args });
|
||||
if (res.errorMessage) {
|
||||
console.error(res.errorMessage);
|
||||
}
|
||||
return res.result || null;
|
||||
},
|
||||
|
||||
updateCollection_meta: true,
|
||||
async updateCollection({ conid, database, changeSet }) {
|
||||
const opened = await this.ensureOpened(conid, database);
|
||||
|
||||
@@ -205,6 +205,17 @@ async function handleLoadKeyInfo({ msgid, key }) {
|
||||
}
|
||||
}
|
||||
|
||||
async function handleCallMethod({ msgid, method, args }) {
|
||||
await waitConnected();
|
||||
const driver = requireEngineDriver(storedConnection);
|
||||
try {
|
||||
const result = await driver.callMethod(systemConnection, method, args);
|
||||
process.send({ msgtype: 'response', msgid, result });
|
||||
} catch (err) {
|
||||
process.send({ msgtype: 'response', msgid, errorMessage: err.message });
|
||||
}
|
||||
}
|
||||
|
||||
async function handleLoadKeyTableRange({ msgid, key, cursor, count }) {
|
||||
await waitConnected();
|
||||
const driver = requireEngineDriver(storedConnection);
|
||||
@@ -283,6 +294,7 @@ const messageHandlers = {
|
||||
collectionData: handleCollectionData,
|
||||
loadKeys: handleLoadKeys,
|
||||
loadKeyInfo: handleLoadKeyInfo,
|
||||
callMethod: handleCallMethod,
|
||||
loadKeyTableRange: handleLoadKeyTableRange,
|
||||
sqlPreview: handleSqlPreview,
|
||||
ping: handlePing,
|
||||
|
||||
Reference in New Issue
Block a user