janeway
janeway copied to clipboard
Dev middleware TimeMonitoring does not work on Macs
Problem
The TimeMonitoring middleware does not work on Darwin / Mac OSX due to an unavailable attribute resource.RUSAGE_THREAD
.
https://github.com/openlibhums/janeway/blob/30fb420ab695d542962770d35f83e7059e9c9c22/src/utils/middleware.py#L76-L79
Proposed solution
Add a try / except to catch the attribute error, and try to fetch the appropriate Darwin resource. If that does not work, exit the middleware gracefully but allow Janeway to run.