fix(feed): fix feed build

This commit is contained in:
Alexey Kasyanchuk
2018-06-13 16:37:22 +03:00
parent 027be8c3f3
commit 88c3b3e3db
4 changed files with 57 additions and 9 deletions

View File

@ -3,7 +3,6 @@ const forBigTable = require('./forBigTable')
const compareVersions = require('compare-versions');
const getTorrent = require('./gettorrent')
const _ = require('lodash')
const Feed = require('./feed')
module.exports = async ({
sphinx,
@ -19,7 +18,8 @@ module.exports = async ({
insertTorrentToDB,
removeTorrentFromDB,
checkTorrent,
p2pStore
p2pStore,
feed
}) => {
let torrentClientHashMap = {}
@ -737,12 +737,8 @@ module.exports = async ({
});
const feed = new Feed({sphinx})
await feed.load()
feed.clear()
setInterval(() => feed.save(), 10000)
// store torrent to feed
await feed.load()
p2pStore.on('store', async ({data: record, temp}) => {
if(!temp || !temp.torrent)
return