ElectronPlatform: Replace the indexSize method with the getStats method.

This commit is contained in:
Damir Jelić 2020-01-21 13:33:20 +01:00
parent e556bb242f
commit e1e3bba290
2 changed files with 16 additions and 15 deletions

View File

@ -346,6 +346,18 @@ ipcMain.on('seshat', async function(ev, payload) {
}
break;
case 'getStats':
if (eventIndex === null) ret = 0;
else {
try {
ret = await eventIndex.getStats();
} catch (e) {
sendError(payload.id, e);
return;
}
}
break;
case 'removeCrawlerCheckpoint':
if (eventIndex === null) ret = false;
else {
@ -381,17 +393,6 @@ ipcMain.on('seshat', async function(ev, payload) {
}
break;
case 'indexSize':
if (eventIndex === null) ret = 0;
else {
try {
ret = await eventIndex.getSize();
} catch (e) {
ret = 0;
}
}
break;
default:
mainWindow.webContents.send('seshatReply', {
id: payload.id,

View File

@ -152,12 +152,12 @@ class SeshatIndexManager extends BaseEventIndexManager {
return this._ipcCall('closeEventIndex');
}
async deleteEventIndex(): Promise<> {
return this._ipcCall('deleteEventIndex');
async getStats(): Promise<> {
return this._ipcCall('getStats');
}
async indexSize(): Promise<> {
return this._ipcCall('indexSize');
async deleteEventIndex(): Promise<> {
return this._ipcCall('deleteEventIndex');
}
}