Skip to content

Commit

Permalink
fix: admin page shows update date
Browse files Browse the repository at this point in the history
  • Loading branch information
ptyoiy committed Apr 10, 2024
1 parent 8aad58d commit 063068b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 5 additions & 6 deletions adminPage/index.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -45,7 +44,7 @@ export const adminOptions: AdminJSOptions = {
withMadeWithLove: false
},
version: {
app: "1.0.0",
app: "update at " + new Date().toLocaleString(),
admin: true
},
// 번역(기본 - en)
Expand Down
4 changes: 3 additions & 1 deletion redis/caching.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export const initAllOngoingEvents = async () => {
// 전체 목록 캐싱
await redisClient.set(redisKey, JSON.stringify(eventsFromDb));

console.log("전체 행사:", await redisClient.get(redisKey));
console.log("진행중인 행사:", eachEvents);
};

Expand Down Expand Up @@ -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);
};

Expand Down

0 comments on commit 063068b

Please sign in to comment.