You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to log envalid errors to our log aggregation service. However, the logger function is async, which means that the reporter callback also has to be async. Here's a pseudocode-y example:
The issue is that the goodEnv should not be used until it is fully checked, which is why there is a process.exit in the reporter - to stop further code from using an unchecked environment. However, the application will only exit when the logger function has finished, which means that further code has a chance to mess something up while it is logging. I also can't make the logger function synchronous because then the logging service request will be cancelled by the application exiting.
Is there any way to make cleanEnv return a promise that resolves when everything is finished, including reporter calls?
The text was updated successfully, but these errors were encountered:
Side note - I'm pretty sure this would mean changes in the cleanEnv code for my specific case. If that's not possible then maybe I can just call the validator functions myself, basically reimplementing cleanEnv?
I'd like to log envalid errors to our log aggregation service. However, the logger function is async, which means that the reporter callback also has to be async. Here's a pseudocode-y example:
The issue is that the
goodEnv
should not be used until it is fully checked, which is why there is aprocess.exit
in the reporter - to stop further code from using an unchecked environment. However, the application will only exit when the logger function has finished, which means that further code has a chance to mess something up while it is logging. I also can't make the logger function synchronous because then the logging service request will be cancelled by the application exiting.Is there any way to make
cleanEnv
return a promise that resolves when everything is finished, including reporter calls?The text was updated successfully, but these errors were encountered: