This commit is contained in:
Alexey Kasyanchuk 2018-07-07 05:59:27 +03:00
parent 8adcdac6f4
commit 805c55849a
3 changed files with 77 additions and 75 deletions

View File

@ -196,7 +196,7 @@ module.exports = async (callback, mainWindow, sphinxApp) => {
let i = 1
const torrents = (await sphinx.query("SELECT COUNT(*) AS c FROM torrents"))[0].c
const torrentsArray = []
let torrentsArray = []
await forBigTable(sphinx, 'torrents', async (torrent) => {
console.log('remember index', torrent.id, torrent.name, '[', i, 'of', torrents, ']')
@ -247,6 +247,8 @@ module.exports = async (callback, mainWindow, sphinxApp) => {
await sphinx.insertValues('torrents', torrent)
})
torrentsArray = null
console.log('optimizing torrents')
if(patchWindow)
patchWindow.webContents.send('optimize', {field: 'torrents'})