File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 1+ import weakref
2+
13import sentry_sdk
24from sentry_sdk .utils import ContextVar , logger
35from sentry_sdk .integrations import Integration
@@ -35,12 +37,22 @@ def processor(event, hint):
3537 if exc_info is None :
3638 return event
3739
40+ last_seen = integration ._last_seen .get (None )
41+ if last_seen is not None :
42+ # last_seen is either a weakref or the original instance
43+ last_seen = last_seen () if callable (last_seen ) else last_seen
44+
3845 exc = exc_info [1 ]
39- if integration . _last_seen . get ( None ) is exc :
46+ if last_seen is exc :
4047 logger .info ("DedupeIntegration dropped duplicated error event %s" , exc )
4148 return None
4249
43- integration ._last_seen .set (exc )
50+ # we can only weakref non builtin types
51+ try :
52+ integration ._last_seen .set (weakref .ref (exc ))
53+ except TypeError :
54+ integration ._last_seen .set (exc )
55+
4456 return event
4557
4658 @staticmethod
You can’t perform that action at this time.
0 commit comments