I am using sentry to monitor my application. The initialization is done like thus:
from functools import lru_cache
import sentry_sdk
@lru_cache
def start_sentry():
sentry_instance = sentry_sdk.init(DSN)
return sentry_instance
Now, if i were to execute start_sentry
multiple times, the multiple sentry_instance
s created are actually all pointing to the same object in memory. Without using the lru_cache
decorator, new sentry instances are crated in memory. So my question is: is using lru caching doing what I am expecting, that is - will it only initialize sentry once even though i attempt to do it multiple times?
i am on python3.6.7 sentry-sdk==0.10.2