Skip to content

Commit

Permalink
Merge pull request #171 from GDSC-PKNU-Official/fix/#169
Browse files Browse the repository at this point in the history
  • Loading branch information
pp449 authored Jan 12, 2024
2 parents b424584 + ad57c1e commit 539f08e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/db/data/noticeHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export const saveWhalebeToDB = async (): Promise<void> => {
const whalebeDatas = await whalebeCrawling();

// TODO: 웨일비 크롤링하는 데이터 추가해야함
const promises = whalebeDatas.map((data) => {
const promises = whalebeDatas.map(async (data) => {
const values = [
data.title,
data.link,
Expand All @@ -217,7 +217,12 @@ export const saveWhalebeToDB = async (): Promise<void> => {
data.imgurl,
];

return db.execute(query, values);
try {
const result = await db.execute(query, values);
return result;
} catch (error) {
console.log(error.message);
}
});

Promise.all(promises);
Expand Down
3 changes: 2 additions & 1 deletion src/hooks/notificateToSlack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const notificationToSlack = async (text: string): Promise<void> => {
text,
});
} catch (error) {
console.error(error);
console.error(error.message);
return notificationToSlack(text);
}
return;
};
Expand Down

0 comments on commit 539f08e

Please sign in to comment.