From 063068b02dd4b88bf18f60828bd44b66e9170ffb Mon Sep 17 00:00:00 2001 From: ptyoiy <56474564+ptyoiy@users.noreply.github.com> Date: Thu, 11 Apr 2024 01:55:51 +0900 Subject: [PATCH] fix: admin page shows update date --- adminPage/index.ts | 11 +++++------ redis/caching.ts | 4 +++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/adminPage/index.ts b/adminPage/index.ts index 26643b7..dd45074 100644 --- a/adminPage/index.ts +++ b/adminPage/index.ts @@ -1,14 +1,13 @@ -import { AdminJSOptions, DefaultAuthProvider, DefaultAuthProviderConfig, LoginHandlerOptions, ResourceWithOptions } from "adminjs"; +import { AdminJSOptions, DefaultAuthProvider, LoginHandlerOptions, ResourceWithOptions } from "adminjs"; +import { compare } from "bcrypt"; +import fs from "fs"; +import * as url from "url"; import { Admin, Alarm, Bookmark, BookmarkAsset, Event, EventsLike, Notice, NoticesLike, Read, ReadAsset, User } from "../models/index.js"; import { Components, componentLoader, isRunOnDist } from "./components/index.js"; import { ADMIN } from './resources/admin.js'; import { COMMON, TEST } from "./resources/common.js"; import { EVENT } from "./resources/event.js"; import { NOTICE } from "./resources/notice.js"; -import { compare } from "bcrypt"; -import * as url from "url"; -import path from "path"; -import fs from "fs"; const authenticate = async (payload, context) => { const {email, role} = payload; @@ -45,7 +44,7 @@ export const adminOptions: AdminJSOptions = { withMadeWithLove: false }, version: { - app: "1.0.0", + app: "update at " + new Date().toLocaleString(), admin: true }, // 번역(기본 - en) diff --git a/redis/caching.ts b/redis/caching.ts index 15644b3..9bfe370 100644 --- a/redis/caching.ts +++ b/redis/caching.ts @@ -30,7 +30,6 @@ export const initAllOngoingEvents = async () => { // 전체 목록 캐싱 await redisClient.set(redisKey, JSON.stringify(eventsFromDb)); - console.log("전체 행사:", await redisClient.get(redisKey)); console.log("진행중인 행사:", eachEvents); }; @@ -61,10 +60,13 @@ export const initAllOngoingNotices = async () => { // 개별 공지 캐싱 await redisClient.set(redisKey, JSON.stringify(notice)); } + console.log('진행중인 긴급공지:', eachNotices) for (const notice of general as INotice[]) { const redisKey = `notice:${notice.id}`; + eachNotices.push(redisKey); await redisClient.set(redisKey, JSON.stringify(notice)); } + console.log('진행중인 일반공지:', eachNotices) await cachingAllNotices(urgent, general); };