File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 1
- import { runWith } from "firebase-functions"
1
+ import { RuntimeOptions , runWith } from "firebase-functions"
2
2
import { DateTime } from "luxon"
3
3
import { JSDOM } from "jsdom"
4
4
import { AssemblyAI } from "assemblyai"
@@ -25,17 +25,23 @@ import fs from "fs"
25
25
abstract class EventScraper < ListItem , Event extends BaseEvent > {
26
26
private schedule
27
27
private timeout
28
+ private memory
28
29
29
- constructor ( schedule : string , timeout : number ) {
30
+ constructor (
31
+ schedule : string ,
32
+ timeout : number ,
33
+ memory : RuntimeOptions [ "memory" ] = "256MB"
34
+ ) {
30
35
this . schedule = schedule
31
36
this . timeout = timeout
37
+ this . memory = memory
32
38
}
33
39
34
40
get function ( ) {
35
41
return runWith ( {
36
42
timeoutSeconds : this . timeout ,
37
43
secrets : [ "ASSEMBLY_API_KEY" ] ,
38
- memory : "2GB"
44
+ memory : this . memory
39
45
} )
40
46
. pubsub . schedule ( this . schedule )
41
47
. onRun ( ( ) => this . run ( ) )
@@ -293,7 +299,7 @@ const shouldScrapeVideo = async (EventId: number) => {
293
299
294
300
class HearingScraper extends EventScraper < HearingListItem , Hearing > {
295
301
constructor ( ) {
296
- super ( "every 60 minutes" , 480 )
302
+ super ( "every 60 minutes" , 480 , "4GB" )
297
303
}
298
304
299
305
async listEvents ( ) {
You can’t perform that action at this time.
0 commit comments