From d4ece4ab1f461653c53bb56f23406c553ea78dd3 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 12 Dec 2017 03:52:14 +0100 Subject: deleting threads with comments and files and s3 files --- bucky/search/bdb.js | 2 +- bucky/search/lexicon.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'bucky/search') diff --git a/bucky/search/bdb.js b/bucky/search/bdb.js index a7ced4a..6f1fd98 100644 --- a/bucky/search/bdb.js +++ b/bucky/search/bdb.js @@ -11,7 +11,7 @@ function db(fn){ fn = "./" + fn + ".db" function exitHandler(options, err) { - db.close() + if (db) db.close() // if (options.cleanup) console.log('clean'); if (err) console.log(err.stack); if (options.exit) process.exit(); diff --git a/bucky/search/lexicon.js b/bucky/search/lexicon.js index 2cf0f21..a9729fd 100644 --- a/bucky/search/lexicon.js +++ b/bucky/search/lexicon.js @@ -4,6 +4,8 @@ var STOPWORDS = require('./stopwords') var bdb = require('./bdb') var db = require('../db') +var search_db = bdb('search') + var lexicon = {} var total = 0 @@ -100,7 +102,7 @@ function lexicon_store () { put_total += 1 // if (put_total > 10) return // console.log(term) - bdb.put(term, serialized) + search_db.put(term, serialized) }) } function serialize_matches (matches) { -- cgit v1.2.3-70-g09d2