Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

부리미 서버 1.06v 배포 #162

Merged
merged 3 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/db/data/noticeHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const saveMajorNotice = async (
else await db.execute(saveNoticeQuery, values);
console.log(`ID: ${departmentId} 공지사항 입력 성공`);
} catch (error) {
notificationToSlack(error.message + '공지사항 입력 실패');
console.log(error.message + '공지사항 입력 실패');
}
};

Expand Down Expand Up @@ -169,7 +169,7 @@ const saveNotice = async (
await db.execute(saveNoticeQuery, values);
console.log('학교 공지사항 입력 성공');
} catch (error) {
notificationToSlack(error.message + '학교 공지사항 입력 실패');
console.log(error.message + '학교 공지사항 입력 실패');
}
};

Expand Down
14 changes: 8 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import noticeRouter from '@apis/notice/controller';
import subscriptionRouter from '@apis/subscribe/controller';
import suggestionRouter from '@apis/suggestion/controller';
import env from '@config';
import { saveMajorNoticeToDB } from '@db/data/noticeHandler';
import { corsOptions } from '@middlewares/cors';
import errorHandler from '@middlewares/error-handler';
import cors from 'cors';
Expand Down Expand Up @@ -41,10 +42,11 @@ app.listen(env.SERVER_PORT, () => {

webpush();

// const handleDeployToServer = async () => {
// // 이 함수는 현재 배포되어있는 서버를 위해 사용되는 로직이며 최초 서버에 배포되는 1회만 실행되도록 하기위한 함수에요
// // 그렇기에 아래에 작성된 코드들은 배포서버에 배포되면 다음 배포전 수정해주세요!!
// // 어학 관련 테이블 생성 후 데이터 삽입
// };
const handleDeployToServer = async () => {
// 이 함수는 현재 배포되어있는 서버를 위해 사용되는 로직이며 최초 서버에 배포되는 1회만 실행되도록 하기위한 함수에요
// 그렇기에 아래에 작성된 코드들은 배포서버에 배포되면 다음 배포전 수정해주세요!!
// 전공 관련 크롤링
await saveMajorNoticeToDB();
};

// handleDeployToServer();
handleDeployToServer();