Handling SIGTERM with Cleanup in Effect Typescript

I have an application booted via NodeRuntime.runMain, and when it receives SIGTERM, I'd like the application to wait for some cleanup operations to complete before it exits. In principle, this is doable with Effect.uninterruptibleMask. However, I'm observing that my application does in fact exit without waiting for the cleanup. I believe this is because somewhere within my application, I'm calling something that's got an Effect.interruptible, which apparently cancels out uninterruptible even if the latter is at the top level of the application? However, it seems that interruption status is not tracked at the type level, so it's proving quite difficult to track down where this might be coming from. Any pointers?
Was this page helpful?