Raul Ponzheimer
Raul Ponzheimer

Reputation: 15

Firebase initialised successfully multiple times and memory issues

My setup is as follows:

I have a main.py file, in which I import all my functions:

from folder.file import function1
from folder.file import function2
    
cred = credentials.ApplicationDefault()
        
__all__ = ["function1","function2",..]

This is how I define the functions:

@firestore_fn.on_document_written(document="collection/{docId}")
def update_collection(event: Event[Change[DocumentSnapshot | None]]) -> None:
    db = firestore.Client() 
    try:
    ....

I successfully deploy all my functions and they work as intended.

The problem is, that they exceed memory limits, when they clearly should not. Also, I do not know if this comes from the definition of the clients inside each function, for which I have not found a workaround,

firebase initialised successfully

is logged multiple times and I cannot discern any execution preceding it.

Upvotes: 0

Views: 25

Answers (0)

Related Questions