?
mindstudio.waitUntil
Keeps the sandbox alive for a fire-and-forget background chain after the method returns.
mindstudio.waitUntil(promise) → void
Keeps the execution sandbox alive for a background chain the method does not await, so a fire-and-forget task is not cut short when the method returns. Pass it the promise for the background work; it returns void, so keep your own reference if you need the result. runTask registers itself automatically, so this is for the other chains, like a .then that writes a record after the method has already responded.
Parameters
promise
Promise<unknown>
RequiredThe background work to keep alive. Returns void, so hold your own reference if you need the result.
Background work
mindstudio.waitUntil((async () => { await enrich(id); })()); return { status: 'enriching' };