From 9dd0e4937a9ed02342e1313d7d5e3a5339c53931 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Thu, 24 Nov 2022 20:32:58 +0100 Subject: [PATCH] Update for refactored backend, fix errors --- index.js | 3 ++- lib/lcsc/task/scrape-category.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index bbc7ecb..78a35e4 100644 --- a/index.js +++ b/index.js @@ -30,6 +30,7 @@ let state = { }; module.exports = { + backend: "postgresql", database: { host: "/run/postgresql", database: "seekseek_documentation" @@ -104,7 +105,7 @@ module.exports = { // FIXME: Commenting out a bunch of tasks but not removing them from the tag assignments will result in an error, but will *not* exit the program. That's probably not right? "lcsc:findCategories": { ttl: "30d", - taskVersion: "1", + version: "1", run: require("./lib/lcsc/task/find-categories")(state) }, "lcsc:scrapeCategory": { diff --git a/lib/lcsc/task/scrape-category.js b/lib/lcsc/task/scrape-category.js index ea65f74..0adafda 100644 --- a/lib/lcsc/task/scrape-category.js +++ b/lib/lcsc/task/scrape-category.js @@ -19,6 +19,7 @@ module.exports = function lcscScrapeCategory(state) { assureResponse(response); assert(response.statusCode === 200); + assert(response.body.productList != null); // Missing from stale queued requests? assert(response.body.productList.length > 0); for (let item of response.body.productList) {