Skip to content

Commit 30af45f

Browse files
committed
update: ECS options and fix message format in cron service
1 parent 391b622 commit 30af45f

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

infrastructure/src/common/ecs.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ export const createECSfargateService = ({
7373
},
7474
},
7575
},
76-
{ replaceOnChanges: ['taskDefinitionArgs.container.image'] },
76+
{
77+
replaceOnChanges: ['taskDefinitionArgs.container.image'],
78+
ignoreChanges: ['taskDefinition.cpu', 'taskDefinition.memory'],
79+
},
7780
)
7881

7982
const resourceId = service.service.id.apply((t) => t.split(':').at(-1)!)

infrastructure/src/lib/ecsOptions.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ const webStageEcsOption: EcsBaseOption = {
2626

2727
const serverProdEcsOption: EcsBaseOption = {
2828
desiredCount: 2,
29-
cpu: 0.5, // unit 1024
30-
memory: 1, // unit 1024
29+
cpu: 1, // unit 1024
30+
memory: 2, // unit 1024
3131
maxCapacity: 12,
3232
minCapacity: 2,
3333
}
@@ -42,8 +42,8 @@ const serverStageEcsOption: EcsBaseOption = {
4242

4343
const cronProdEcsOption: EcsBaseOption = {
4444
desiredCount: 1,
45-
cpu: 1, // unit 1024
46-
memory: 2, // unit 1024
45+
cpu: 0.5, // unit 1024
46+
memory: 1, // unit 1024
4747
maxCapacity: 1,
4848
minCapacity: 1,
4949
}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@ export class PostService implements Service {
128128

129129
setTimeout(() => {
130130
const message = {
131-
text: `[Captured By Bot], *userId*: ${user_id}\ntitle: ${post.title}, ip: ${ip}, country: ${country} type: spam,
132-
reason: ${reason}`,
131+
text: `[Captured By Cron], *userId*: ${user_id}\ntitle: ${post.title}, ip: ${ip}, country: ${country}, reason: ${reason}, type: spam`,
133132
}
134133

135134
if (targetType) {

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,12 @@ export class StatsService implements Service {
3434
const usersCount = await this.getUsersCount(start, end)
3535
const postCount = await this.getPostsCount(start, end)
3636

37-
const timeFormat = 'yyyy-MM-dd HH:mm:ss'
3837
await this.discord.sendMessage(
3938
'stats',
40-
`[Daily]\n기간: ${format(start, timeFormat)}-${format(
41-
end,
42-
'HH:mm:ss',
43-
)}\n${usersCount}명의 사용자가 가입했습니다.\n${postCount}개의 공개 포스트가 작성되었습니다.`,
39+
`[Daily]\n기간: ${format(
40+
start,
41+
'yyyy-MM-dd',
42+
)}}\n${usersCount}명의 사용자가 가입했습니다.\n${postCount}개의 공개 포스트가 작성되었습니다.`,
4443
)
4544
}
4645
public async weekly() {
@@ -50,12 +49,11 @@ export class StatsService implements Service {
5049
const usersCount = await this.getUsersCount(start, end)
5150
const postCount = await this.getPostsCount(start, end)
5251

53-
const timeFormat = 'yyyy-MM-dd HH:mm:ss'
5452
await this.discord.sendMessage(
5553
'stats',
56-
`[Weekly]\n기간: ${format(start, timeFormat)} ~ ${format(
57-
end,
58-
timeFormat,
54+
`[Weekly]\n기간: ${format(
55+
start,
56+
'yyyy-MM-dd',
5957
)}\n${usersCount}명의 사용자가 가입했습니다.\n${postCount}개의 공개 포스트가 작성되었습니다.`,
6058
)
6159
}

0 commit comments

Comments
 (0)