Skip to content

Commit

Permalink
✨feature : batch 스케줄러 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
ParkYunHo committed Jul 25, 2023
1 parent 27a9fdd commit f6a0624
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 49 deletions.
46 changes: 0 additions & 46 deletions .github/workflows/ci-batch.yaml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/drwtStore-batch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: drwtStore-batch

on:
schedule:
- cron: '0 21 * * SUN' # 매주 일요일 21시

jobs:
drwtStore-batch:
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v2

- name: Setup JDK
uses: actions/setup-java@v1
with:
java-version: 17

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build Gradle
run: ./gradlew clean --stacktrace --build-file=./batch/build.gradle.kts build

- name: Job Execute
run: java -jar --Dspring.profiles.active=prod --job.name=lottoDrwtStoreJob ./build/libs/batch-0.0.1-SNAPSHOT.jar
39 changes: 39 additions & 0 deletions .github/workflows/number-batch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: number-batch

on:
workflow_dispatch:
inputs:
startDrwtNo:
description: 시작회차
default: ""
type: string
endDrwtNo:
description: 종료회차
default: ""
type: string
schedule:
- cron: '0 21 * * SUN' # 매주 일요일 21시

jobs:
number-batch:
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v2

- name: Setup JDK
uses: actions/setup-java@v1
with:
java-version: 17

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build Gradle
run: ./gradlew clean --stacktrace --build-file=./batch/build.gradle.kts build

- name: Job Execute
run: java -jar --Dspring.profiles.active=prod --job.name=lottoNumberJob startDrwtNo=$START_DRWTNO endDrwtNo=$END_DRWTNO ./build/libs/batch-0.0.1-SNAPSHOT.jar
env:
START_DRWTNO: ${{ inputs.startDrwtNo }}
END_DRWTNO: ${{ inputs.endDrwtNo }}
26 changes: 26 additions & 0 deletions .github/workflows/store-batch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: store-batch

on:
schedule:
- cron: '0 21 1 */6 *' # 6개월마다 1일 21시 (1/1, 7/1)

jobs:
store-batch:
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v2

- name: Setup JDK
uses: actions/setup-java@v1
with:
java-version: 17

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build Gradle
run: ./gradlew clean --stacktrace --build-file=./batch/build.gradle.kts build

- name: Job Execute
run: java -jar --Dspring.profiles.active=prod --job.name=lottoStoreJob ./build/libs/batch-0.0.1-SNAPSHOT.jar
4 changes: 2 additions & 2 deletions batch/src/main/resources/application-batch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ spring:
client:
config:
default:
connect-timeout: 3000
read-timeout: 3000
connect-timeout: 10000
read-timeout: 10000
2 changes: 1 addition & 1 deletion core/src/main/resources/application-core-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spring:
generate-ddl: true
datasource:
hikari:
connection-timeout: 20000
connection-timeout: 10000
minimum-idle: 10
maximum-pool-size: 100

Expand Down

0 comments on commit f6a0624

Please sign in to comment.