From 60c83cebedf33bf20f15e27e9a009797a81b7ee9 Mon Sep 17 00:00:00 2001 From: Siddharth VP Date: Wed, 6 Nov 2024 22:06:02 +0530 Subject: [PATCH] category-counts: fix missing import and file name in jobs.yml --- category-counts/main.ts | 5 ++++- jobs.yml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/category-counts/main.ts b/category-counts/main.ts index a5a1210..7c932ab 100644 --- a/category-counts/main.ts +++ b/category-counts/main.ts @@ -1,9 +1,10 @@ -import {bot, emailOnError, log} from "../botbase"; +import {bot, emailOnError, log, fs} from "../botbase"; import {ApiQueryCategoryInfoParams} from "types-mediawiki/api_params"; import {ElasticDataStore} from "../elasticsearch"; import {getKey, normalizeCategory} from "./util"; (async function () { + log(`[i] Started`); const countStore = new ElasticDataStore('category-counts-enwiki'); await bot.getTokensAndSiteInfo(); @@ -40,6 +41,7 @@ import {getKey, normalizeCategory} from "./util"; } } } + log(`[i] Finished updating data in ElasticSearch`) // Backup data to NFS process.chdir(__dirname); @@ -47,5 +49,6 @@ import {getKey, normalizeCategory} from "./util"; `backups/category-counts-backup-${new bot.Date().format('YYYY-MM-DD', 'utc')}.json`, JSON.stringify(countStore.dump(), null, 2) ); + log(`[i] Finished backing up counts on disk`); })().catch(err => emailOnError(err, 'cat-counts')); diff --git a/jobs.yml b/jobs.yml index 9be49b3..0722bdf 100644 --- a/jobs.yml +++ b/jobs.yml @@ -25,4 +25,4 @@ - {"schedule": "25 1,5,9,13,17,21 * * *", "name": "db-tabulator", mem: "512Mi", "command": "~/SDZeroBot/job db-tabulator/main.js", "image": "node18", "emails": "onfailure"} - {"schedule": "8 16 * * *", "name": "gans-list", mem: "256Mi", "command": "~/SDZeroBot/job most-gans/gans-lister.js", "image": "node18", "emails": "onfailure"} - {"schedule": "0 4 * * *", "name": "shells", mem: "128Mi", "command": "~/SDZeroBot/job terminate-shell-pods.js", "image": "node18", "emails": "onfailure"} -- {"schedule": "15 1 * * *", "name": "cat-count", mem: "256Mi", "command": "~/SDZeroBot/job category-counter/main.js", "image": "node18", "emails": "onfailure"} +- {"schedule": "15 1 * * *", "name": "cat-count", mem: "256Mi", "command": "~/SDZeroBot/job category-counts/main.js", "image": "node18", "emails": "onfailure"}