2019-04-29 23:36:04 +03:00
|
|
|
const Database = require('better-sqlite3');
|
2021-01-28 14:24:02 +02:00
|
|
|
const db = new Database('data/bot-node.db');
|
2019-04-29 23:36:04 +03:00
|
|
|
const Jackd = require('jackd');
|
|
|
|
const beanstalkd = new Jackd();
|
|
|
|
|
|
|
|
|
2021-01-28 14:34:41 +02:00
|
|
|
|
2019-04-29 23:36:04 +03:00
|
|
|
async function foo() {
|
|
|
|
|
|
|
|
// get all feeds from DB
|
|
|
|
let feeds = db.prepare('select feed from feeds').all();
|
|
|
|
|
|
|
|
console.log('!!!',feeds.length);
|
|
|
|
|
|
|
|
let count = 0;
|
|
|
|
|
2021-01-28 14:45:05 +02:00
|
|
|
await beanstalkd.connect({host: 'beanstalkd', port: 11300 })
|
2019-04-29 23:36:04 +03:00
|
|
|
|
|
|
|
for (feed of feeds) {
|
|
|
|
await beanstalkd.put(feed.feed)
|
|
|
|
}
|
|
|
|
|
|
|
|
await beanstalkd.disconnect()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
foo()
|