Skip to content

Commit 3d83dce

Browse files
committed
chore(notifications): Delete httpsCleanNotifications firebase function - we can always trigger the scheduled function manually if need be
1 parent a3082e8 commit 3d83dce

File tree

3 files changed

+1
-25
lines changed

3 files changed

+1
-25
lines changed

functions/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ export {
3636
populateTestimonySubmissionNotificationEvents,
3737
cleanupNotifications,
3838
deliverNotifications,
39-
httpsCleanupNotifications,
4039
updateUserNotificationFrequency
4140
} from "./notifications"
4241

functions/src/notifications/cleanupNotifications.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,3 @@ const runCleanupNotifications = async () => {
6767
export const cleanupNotifications = functions.pubsub
6868
.schedule("every 24 hours")
6969
.onRun(runCleanupNotifications)
70-
71-
export const httpsCleanupNotifications = functions.https.onRequest(
72-
async (request, response) => {
73-
try {
74-
console.log("httpsCleanupNotifications triggered")
75-
await runCleanupNotifications()
76-
console.log("DEBUG: cleanupNotifications completed")
77-
78-
response
79-
.status(200)
80-
.send(
81-
"Successfully cleaned up old notifications, topic events, and email documents"
82-
)
83-
} catch (error) {
84-
console.error("Error in httpsCleanupNotifications:", error)
85-
response.status(500).send("Internal server error")
86-
}
87-
}
88-
)

functions/src/notifications/index.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
import { publishNotifications } from "./publishNotifications"
33
import { populateBillHistoryNotificationEvents } from "./populateBillHistoryNotificationEvents"
44
import { populateTestimonySubmissionNotificationEvents } from "./populateTestimonySubmissionNotificationEvents"
5-
import {
6-
cleanupNotifications,
7-
httpsCleanupNotifications
8-
} from "./cleanupNotifications"
5+
import { cleanupNotifications } from "./cleanupNotifications"
96
import { deliverNotifications } from "./deliverNotifications"
107
import { updateUserNotificationFrequency } from "./updateUserNotificationFrequency"
118

@@ -16,6 +13,5 @@ export {
1613
populateTestimonySubmissionNotificationEvents,
1714
cleanupNotifications,
1815
deliverNotifications,
19-
httpsCleanupNotifications,
2016
updateUserNotificationFrequency
2117
}

0 commit comments

Comments
 (0)