feat: initial app prototype

This commit is contained in:
2025-01-20 18:36:05 -08:00
parent 3abc3e3272
commit d7cd3ffaab
21 changed files with 5187 additions and 0 deletions

View File

@ -0,0 +1,21 @@
/**
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import { errorHandler } from "../utils/errorHandler.js";
import type { App } from "../interfaces/app.js";
/**
* Updates the cache of sanctions.
* @param app - The application instance.
*/
export const updateCache = async(app: App): Promise<void> => {
try {
app.cacheUpdated = new Date();
// eslint-disable-next-line require-atomic-updates -- We're allowing this so we can update the cache on an interval.
app.sanctions = await app.database.sanctions.findMany();
} catch (error) {
await errorHandler("update cache module", error);
}
};