Skip to content

Commit fc8edf9

Browse files
committed
refactor: 영향 없는 수준에서 maxInstances 조절
1 parent a7ae679 commit fc8edf9

10 files changed

Lines changed: 23 additions & 12 deletions

File tree

Firebase/functions/src/auth/apple.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function getAppleConfiguration() {
5454

5555
export const requestAppleCustomToken = onCall({
5656
cors: true,
57-
maxInstances: 10,
57+
maxInstances: 3,
5858
region: "asia-northeast3",
5959
}, async (request) => {
6060
try {
@@ -142,7 +142,7 @@ export const requestAppleCustomToken = onCall({
142142

143143
export const requestAppleRefreshToken = onCall({
144144
cors: true,
145-
maxInstances: 10,
145+
maxInstances: 3,
146146
region: "asia-northeast3",
147147
}, async (request) => {
148148
if (!request.auth) {
@@ -186,7 +186,7 @@ export const requestAppleRefreshToken = onCall({
186186

187187
export const refreshAppleAccessToken = onCall({
188188
cors: true,
189-
maxInstances: 10,
189+
maxInstances: 3,
190190
region: "asia-northeast3",
191191
}, async (request) => {
192192
// 인증 확인
@@ -267,7 +267,7 @@ export const refreshAppleAccessToken = onCall({
267267

268268
export const revokeAppleAccessToken = onCall({
269269
cors: true,
270-
maxInstances: 10,
270+
maxInstances: 3,
271271
region: "asia-northeast3",
272272
}, async (request) => {
273273
// 인증 확인

Firebase/functions/src/auth/github.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import axios from "axios";
55
// GitHub OAuth 인증 및 커스텀 토큰 발급 함수
66
export const requestGithubTokens = onCall({
77
cors: true,
8-
maxInstances: 10,
8+
maxInstances: 3,
99
region: "asia-northeast3",
1010
}, async (request) => {
1111
try {
@@ -103,7 +103,7 @@ export const requestGithubTokens = onCall({
103103

104104
export const revokeGithubAccessToken = onCall({
105105
cors: true,
106-
maxInstances: 10,
106+
maxInstances: 3,
107107
region: "asia-northeast3",
108108
}, async (request) => {
109109
try {

Firebase/functions/src/fcm/notification.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ type FirestoreErrorLike = {
1818

1919
// Cloud Tasks에 의해 트리거되는 함수
2020
export const sendPushNotification = onTaskDispatched({
21+
maxInstances: 2,
2122
region: "asia-northeast3",
2223
retryConfig: { maxAttempts: 3, minBackoffSeconds: 5 },
2324
rateLimits: { maxDispatchesPerSecond: 200 },

Firebase/functions/src/fcm/schedule.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ type ErrorLike = {
2525
};
2626

2727
export const scheduleTodoReminder = onSchedule({
28+
maxInstances: 2,
2829
region: LOCATION,
2930
schedule: "*/5 * * * *",
3031
timeZone: "UTC"

Firebase/functions/src/notification/deletion.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type NotificationDeletionTaskData = {
1616

1717
export const requestPushNotificationDeletion = onCall({
1818
cors: true,
19-
maxInstances: 10,
19+
maxInstances: 3,
2020
region: LOCATION,
2121
},
2222
async (request) => {
@@ -94,7 +94,7 @@ export const requestPushNotificationDeletion = onCall({
9494

9595
export const undoPushNotificationDeletion = onCall({
9696
cors: true,
97-
maxInstances: 10,
97+
maxInstances: 3,
9898
region: LOCATION,
9999
},
100100
async (request) => {
@@ -147,6 +147,7 @@ export const undoPushNotificationDeletion = onCall({
147147
);
148148

149149
export const completePushNotificationDeletion = onTaskDispatched({
150+
maxInstances: 2,
150151
region: LOCATION,
151152
retryConfig: {maxAttempts: 3, minBackoffSeconds: 5},
152153
rateLimits: {maxDispatchesPerSecond: 200},

Firebase/functions/src/todo/cleanup.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const DELETE_BATCH_SIZE = 200;
88
const QUERY_BATCH_SIZE = 100;
99

1010
export const removeTodoNotificationDocuments = onDocumentDeleted({
11+
maxInstances: 2,
1112
document: "users/{userId}/todoLists/{todoId}",
1213
region: LOCATION
1314
},
@@ -29,6 +30,7 @@ export const removeTodoNotificationDocuments = onDocumentDeleted({
2930
);
3031

3132
export const removeCompletedTodoNotificationRecords = onDocumentUpdated({
33+
maxInstances: 2,
3234
document: "users/{userId}/todoLists/{todoId}",
3335
region: LOCATION
3436
},
@@ -64,6 +66,7 @@ export const removeCompletedTodoNotificationRecords = onDocumentUpdated({
6466
);
6567

6668
export const cleanupUnusedTodoNotificationRecords = onSchedule({
69+
maxInstances: 2,
6770
region: LOCATION,
6871
schedule: "0 * * * *",
6972
timeZone: "UTC"

Firebase/functions/src/todo/deletion.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type TodoDeletionTaskData = {
1717

1818
export const requestTodoDeletion = onCall({
1919
cors: true,
20-
maxInstances: 10,
20+
maxInstances: 3,
2121
region: LOCATION,
2222
},
2323
async (request) => {
@@ -105,7 +105,7 @@ export const requestTodoDeletion = onCall({
105105

106106
export const undoTodoDeletion = onCall({
107107
cors: true,
108-
maxInstances: 10,
108+
maxInstances: 3,
109109
region: LOCATION,
110110
},
111111
async (request) => {
@@ -163,6 +163,7 @@ export const undoTodoDeletion = onCall({
163163
);
164164

165165
export const completeTodoDeletion = onTaskDispatched({
166+
maxInstances: 2,
166167
region: LOCATION,
167168
retryConfig: {maxAttempts: 3, minBackoffSeconds: 5},
168169
rateLimits: {maxDispatchesPerSecond: 200},

Firebase/functions/src/todo/update.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const LOCATION = "asia-northeast3";
77
const BATCH_SIZE = 200;
88

99
export const syncTodoNotificationCategory = onDocumentUpdated({
10+
maxInstances: 2,
1011
document: "users/{userId}/todoLists/{todoId}",
1112
region: LOCATION
1213
},

Firebase/functions/src/todoCategory/update.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ type TodoCategoryUpdateTaskData = {
2121
};
2222

2323
export const requestMoveRemovedCategoryTodosToEtc = onDocumentUpdated({
24+
maxInstances: 2,
2425
document: "users/{userId}/userData/categories",
2526
region: LOCATION
2627
},
@@ -80,6 +81,7 @@ export const requestMoveRemovedCategoryTodosToEtc = onDocumentUpdated({
8081
);
8182

8283
export const completeMoveRemovedCategoryTodosToEtc = onTaskDispatched({
84+
maxInstances: 2,
8385
region: LOCATION,
8486
retryConfig: { maxAttempts: 3, minBackoffSeconds: 5 },
8587
rateLimits: { maxDispatchesPerSecond: 20 },

Firebase/functions/src/webPage/deletion.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type WebPageDeletionTaskData = {
1717

1818
export const requestWebPageDeletion = onCall({
1919
cors: true,
20-
maxInstances: 10,
20+
maxInstances: 3,
2121
region: LOCATION,
2222
},
2323
async (request) => {
@@ -101,7 +101,7 @@ export const requestWebPageDeletion = onCall({
101101

102102
export const undoWebPageDeletion = onCall({
103103
cors: true,
104-
maxInstances: 10,
104+
maxInstances: 3,
105105
region: LOCATION,
106106
},
107107
async (request) => {
@@ -163,6 +163,7 @@ export const undoWebPageDeletion = onCall({
163163
);
164164

165165
export const completeWebPageDeletion = onTaskDispatched({
166+
maxInstances: 2,
166167
region: LOCATION,
167168
retryConfig: { maxAttempts: 3, minBackoffSeconds: 5 },
168169
rateLimits: { maxDispatchesPerSecond: 200 },

0 commit comments

Comments
 (0)