Skip to content

Commit 1a07a0f

Browse files
authored
Merge pull request #1851 from Mephistic/bump-up-memory
Bump memory for hearings scraper up to 4GB
2 parents f531c26 + ae09aaf commit 1a07a0f

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

functions/src/events/scrapeEvents.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { runWith } from "firebase-functions"
1+
import { RuntimeOptions, runWith } from "firebase-functions"
22
import { DateTime } from "luxon"
33
import { JSDOM } from "jsdom"
44
import { AssemblyAI } from "assemblyai"
@@ -25,17 +25,23 @@ import fs from "fs"
2525
abstract class EventScraper<ListItem, Event extends BaseEvent> {
2626
private schedule
2727
private timeout
28+
private memory
2829

29-
constructor(schedule: string, timeout: number) {
30+
constructor(
31+
schedule: string,
32+
timeout: number,
33+
memory: RuntimeOptions["memory"] = "256MB"
34+
) {
3035
this.schedule = schedule
3136
this.timeout = timeout
37+
this.memory = memory
3238
}
3339

3440
get function() {
3541
return runWith({
3642
timeoutSeconds: this.timeout,
3743
secrets: ["ASSEMBLY_API_KEY"],
38-
memory: "2GB"
44+
memory: this.memory
3945
})
4046
.pubsub.schedule(this.schedule)
4147
.onRun(() => this.run())
@@ -293,7 +299,7 @@ const shouldScrapeVideo = async (EventId: number) => {
293299

294300
class HearingScraper extends EventScraper<HearingListItem, Hearing> {
295301
constructor() {
296-
super("every 60 minutes", 480)
302+
super("every 60 minutes", 480, "4GB")
297303
}
298304

299305
async listEvents() {

0 commit comments

Comments
 (0)