Skip to content

Commit

Permalink
refactor: 1시간마다 Lambda 트리거
Browse files Browse the repository at this point in the history
  • Loading branch information
ppinkypeach committed Feb 10, 2024
1 parent 40578da commit 14eda6f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SlackViewAction, ViewOutput } from "@slack/bolt";
import { uploadBlogToNotion } from "./uploadBlogToNotion";
import { WebClient } from "@slack/web-api";

export async function handlerBlogUploadSubmission(body: SlackViewAction, view: ViewOutput, client: any){
const userId = body.user.id;
const slackUserInfo = await client.users.info({user: userId});
Expand Down
8 changes: 7 additions & 1 deletion serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ provider:
TEAM_JOON_CHANNEL: ${env:TEAM_JOON_CHANNEL}
DEBUG_CHANNEL: ${env:DEBUG_CHANNEL}


functions:
slackBotHandler:
handler: dist/utils/function/lambdaHandler/handler.handler
Expand All @@ -31,6 +30,13 @@ functions:
- httpApi:
method: POST
path: /slack/uploadNotion
- schedule:
rate: rate(1 hour)
enabled: true
input:
detail-type: "ScheduledEvent"
source: "aws.events"
detail: {}
SendBlogInfoToSlackSchedule:
handler: dist/scheduler/sendBlogInfoToSlackChannel.handler
timeout: 20
Expand Down

0 comments on commit 14eda6f

Please sign in to comment.