Skip to content

Commit 5f0cc6b

Browse files
committed
Merge remote-tracking branch 'origin/development'
2 parents 246c7ad + af78a70 commit 5f0cc6b

File tree

7 files changed

+24
-18
lines changed

7 files changed

+24
-18
lines changed

infrastructure/src/common/ecs.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const createECSfargateService = ({
4040
subnets: subnetIds,
4141
},
4242
taskDefinitionArgs: {
43+
// TODO: Ignore changes for taskDefinitionArgs.cpu, memory
4344
// cpu: option.taskCpu,
4445
// memory: option.taskMemory,
4546
executionRole: {
@@ -88,7 +89,7 @@ export const createECSfargateService = ({
8889
scalableDimension: 'ecs:service:DesiredCount',
8990
serviceNamespace: 'ecs',
9091
},
91-
{ replaceOnChanges: ['resourceId'] },
92+
// { replaceOnChanges: ['resourceId'] },
9293
)
9394

9495
const ecsCPUPolicy = new aws.appautoscaling.Policy(
@@ -107,7 +108,7 @@ export const createECSfargateService = ({
107108
scaleOutCooldown: 60,
108109
},
109110
},
110-
{ replaceOnChanges: ['resourceId'] },
111+
// { replaceOnChanges: ['resourceId'] },
111112
)
112113

113114
const ecsMemoryPolicy = new aws.appautoscaling.Policy(
@@ -126,6 +127,6 @@ export const createECSfargateService = ({
126127
scaleOutCooldown: 60,
127128
},
128129
},
129-
{ replaceOnChanges: ['resourceId'] },
130+
// { replaceOnChanges: ['resourceId'] },
130131
)
131132
}

infrastructure/src/lib/ecsOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const serverProdEcsOption: EcsBaseOption = {
2929
cpu: 1, // unit 1024
3030
memory: 2, // unit 1024
3131
maxCapacity: 12,
32-
minCapacity: 2,
32+
minCapacity: 1,
3333
}
3434

3535
const serverStageEcsOption: EcsBaseOption = {

packages/velog-cron/src/lib/discord/DiscordService.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ export class DiscordService {
5656
const channel = await this.client.channels.fetch(channelId)
5757

5858
if (channel?.isTextBased()) {
59-
if (message.length > 2000) {
60-
console.log('message', message)
59+
const chunkSize = 2000
60+
for (let i = 0; i < message.length; i += chunkSize) {
61+
await channel.send(message.slice(i, i + chunkSize))
6162
}
62-
await channel.send(message.slice(0, 2000))
6363
} else {
6464
throw new Error('Wrong channel type')
6565
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export class PostService implements Service {
146146
country: string,
147147
): Promise<{ isSpam: boolean; reason: string; targetType?: string }> {
148148
const allowList = ['KR', 'GB', '']
149-
const blockList = ['IN', 'PK', 'CN', 'VN', 'TH', 'PH']
149+
const blockList = ['IN', 'PK', 'CN', 'VN', 'TH', 'PH', 'UG']
150150
const isForeign = !allowList.includes(country)
151151

152152
if (blockList.includes(country)) {
@@ -201,7 +201,7 @@ export class PostService implements Service {
201201

202202
const containsPhoneNumber = phoneRegex.some((regex) => regex.test(replaced))
203203

204-
if (containsPhoneNumber) {
204+
if (containsPhoneNumber && isForeign) {
205205
return { isSpam: true, reason: 'containsPhoneNumber' }
206206
}
207207

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,19 @@ export class StatsService implements Service {
4343
)
4444
}
4545
public async weekly() {
46-
const start = startOfWeek(subWeeks(new Date(), 1), { weekStartsOn: 1 }) // 월요일부터 시작
47-
const end = endOfWeek(subWeeks(new Date(), 1))
46+
const oneWeekAgo = subWeeks(new Date(), 1)
47+
const start = startOfWeek(oneWeekAgo, { weekStartsOn: 1 }) // 월요일부터 시작
48+
const end = endOfWeek(oneWeekAgo, { weekStartsOn: 1 })
4849

4950
const usersCount = await this.getUsersCount(start, end)
5051
const postCount = await this.getPostsCount(start, end)
5152

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

packages/velog-scripts/lib/discord/DiscordService.mts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ export class DiscordService {
3333
const channel = await this.client.channels.fetch(channelId)
3434

3535
if (channel?.isTextBased()) {
36-
await channel.send(message)
36+
const chunkSize = 2000
37+
for (let i = 0; i < message.length; i += chunkSize) {
38+
await channel.send(message.slice(i, i + chunkSize))
39+
}
3740
} else {
3841
throw new Error('Wrong channel type')
3942
}

packages/velog-server/src/lib/discord/DiscordService.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ export class DiscordService {
6060
const channel = await this.client.channels.fetch(channelId)
6161

6262
if (channel?.isTextBased()) {
63-
if (message.length > 2000) {
64-
console.log('message', message)
63+
const chunkSize = 2000
64+
for (let i = 0; i < message.length; i += chunkSize) {
65+
await channel.send(message.slice(i, i + chunkSize))
6566
}
66-
await channel.send(message.slice(0, 2000))
6767
} else {
6868
throw new Error('Wrong channel type')
6969
}

0 commit comments

Comments
 (0)