Skip to content

Commit

Permalink
update recache timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Akhil Pillai committed Dec 27, 2024
1 parent 5f7cb0b commit 5b5dcff
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 94 deletions.
157 changes: 73 additions & 84 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
{
"author": "Akhil Pillai",
"dependencies": {
"@discordjs/collection": "^2.1.1",
"discord.js": "^14.16.3",
"dotenv": "^16.4.7",
"express": "^4.21.2",
"helmet": "^8.0.0",
"jsoning": "^1.0.1",
"luxon": "^3.5.0",
"node-schedule": "^2.1.1",
"pino": "^9.5.0",
"pino": "^9.6.0",
"pino-pretty": "^13.0.0"
},
"devDependencies": {
"@types/express": "^5.0.0",
"@types/luxon": "^3.4.2",
"@types/node-schedule": "^2.1.7",
"@typescript-eslint/eslint-plugin": "^8.18.1",
"@typescript-eslint/parser": "^8.18.1",
"knip": "^5.41.0",
"npm-check-updates": "^17.1.11",
"@typescript-eslint/eslint-plugin": "^8.18.2",
"@typescript-eslint/parser": "^8.18.2",
"knip": "^5.41.1",
"npm-check-updates": "^17.1.12",
"prettier": "^3.4.2",
"tsx": "^4.19.2",
"typescript": "^5.7.2"
Expand Down
9 changes: 4 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { argv, stdout } from 'process';
import { dirname, join } from 'path';
import { fileURLToPath } from 'url';
import { readdir, rm } from 'fs/promises';
import { Jsoning } from 'jsoning';
import { Jsoning, JSONValue } from 'jsoning';
import { DevIds, permissionsBits, PORT } from './config';
import { Command, CommandClient, createServer, logger, Methods } from './lib';
import { scheduleJob } from 'node-schedule';
Expand Down Expand Up @@ -135,8 +135,7 @@ for (const file of commandFiles) {
if (command.help)
await cmndb.set(
command.data.name,
// @ts-expect-error types
command.help.toJSON()
command.help.toJSON() as unknown as JSONValue
);
}
client.commands.freeze();
Expand Down Expand Up @@ -216,8 +215,8 @@ process.on('uncaughtException', sendError);
process.on('unhandledRejection', sendError);
logger.debug('Set up error handling.');

// refresh cached kumilinwa spec every hour
scheduleJob('0 * * * *', refreshCachedLangSpec);
// refresh cached language specification every 5 minutes
scheduleJob('*/5 * * * *', refreshCachedLangSpec);

logger.info('Process setup complete.');

Expand Down

0 comments on commit 5b5dcff

Please sign in to comment.