I have multiple helper functions on frontend where I initialize Parse, and then run a cloud function. They look like this:
const Parse = (await import("parse")).default;
export async function cancelOperation({ operationId }) {
Parse.initialize(process.env.NEXT_PUBLIC_APP_ID);
Parse.serverURL = `${process.env.NEXT_PUBLIC_SERVER_URL}/parse`;
await Parse.Cloud.run("cancelOperation", { operationId });
}
Iām wondering if each of them creates a separate Parse instance that continues to run in the background consuming resources. Is that the case? If so, how can I terminate the instance after I ran the function?