From 6168f98b8e60ff1ac9f53a6695c6d4ef9d190bba Mon Sep 17 00:00:00 2001 From: Matchu Date: Mon, 28 Dec 2020 14:04:28 -0800 Subject: [PATCH] include previous misses in cache-asset-manifests Originally, this was sorta a cache warmup script: we wanted to fill in manifests that we hadn't checked for yet. But now, I want to _also_ check previous cache misses, that we stored in the db as an empty string. Maybe it's been converted now! --- scripts/cache-asset-manifests.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/cache-asset-manifests.js b/scripts/cache-asset-manifests.js index 821669d..9259ec3 100644 --- a/scripts/cache-asset-manifests.js +++ b/scripts/cache-asset-manifests.js @@ -16,10 +16,9 @@ const connectToDb = require("../src/server/db"); const neopetsAssets = require("../src/server/neopets-assets"); async function cacheAssetManifests(db) { - const [ - rows, - ] = await db.execute( - `SELECT id, url FROM swf_assets WHERE manifest IS NULL AND id >= ? ` + + const [rows] = await db.execute( + `SELECT id, url FROM swf_assets ` + + `WHERE manifest IS NULL OR manifest = "" AND id >= ? ` + `ORDER BY id`, [argv.start || 0] );