Skip to content

Commit ab005fc

Browse files
committed
feat: remove throw error
1 parent 90f9d30 commit ab005fc

File tree

5 files changed

+18
-48
lines changed

5 files changed

+18
-48
lines changed

infrastructure/Pulumi.production.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
config:
22
aws:region: ap-northeast-2
33
velog:DOCKER_ENV: production
4-
velog:target: server
4+
velog:target: cron

infrastructure/Pulumi.stage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
config:
22
aws:region: ap-northeast-2
33
velog:DOCKER_ENV: stage
4-
velog:target: cron
4+
velog:target: server

infrastructure/src/lib/ecsOptions.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
import { ENV } from '../env'
22

3-
const serverEcsOption: EcsOption = {
3+
const webEcsOption: EcsOption = {
44
desiredCount: ENV.isProduction ? 2 : 1,
5-
cpu: ENV.isProduction ? 512 : 512,
6-
memory: 1024,
5+
cpu: ENV.isProduction ? 1024 : 512,
6+
memory: ENV.isProduction ? 2048 : 1024,
77
maxCapacity: 12,
88
minCapacity: ENV.isProduction ? 2 : 1,
99
}
1010

11-
const webEcsOption: EcsOption = {
11+
const serverEcsOption: EcsOption = {
1212
desiredCount: ENV.isProduction ? 2 : 1,
13-
cpu: ENV.isProduction ? 1024 : 512,
14-
memory: ENV.isProduction ? 2048 : 1024,
13+
cpu: ENV.isProduction ? 1024 * 0.75 : 512,
14+
memory: 1024,
1515
maxCapacity: 12,
1616
minCapacity: ENV.isProduction ? 2 : 1,
1717
}
1818

1919
const cronEcsOption: EcsOption = {
2020
desiredCount: 1,
21-
cpu: 512,
21+
cpu: ENV.isProduction ? 1024 : 512,
2222
memory: 1024,
2323
maxCapacity: 1,
2424
minCapacity: ENV.isProduction ? 1 : 0,

packages/velog-cron/src/services/PostService/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ export class PostService implements Service {
8787
})
8888

8989
if (!post) {
90-
throw new NotFoundError('Not found Post')
90+
console.log('Not found Post when spam check')
91+
return
9192
}
9293

9394
const user = await this.db.user.findUnique({
@@ -99,9 +100,7 @@ export class PostService implements Service {
99100
},
100101
})
101102

102-
if (!user) {
103-
throw new NotFoundError('Not found User')
104-
}
103+
if (!user) return
105104

106105
const country = geoip.lookup(ip)?.country ?? ''
107106

pnpm-lock.yaml

Lines changed: 6 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)