File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 22
33Please use [ this] ( https://docs.gitlab.com/ee/development/changelog.html ) document as guidelines to keep a changelog.
44
5+ ## [ unreleased]
6+
7+ ### Fixed
8+
9+ * cli: Ignore ` SIGINT ` signal when shutdown is in progress.
10+ * sentry: Ignore exceptions when shutdown is in progress.
11+
512## 4.1.1 - 2022-01-25
613
714### Fixed
Original file line number Diff line number Diff line change 5757from dipdup .utils .database import wipe_schema
5858
5959_logger = logging .getLogger ('dipdup.cli' )
60+ _is_shutting_down = False
6061
6162
6263def echo (message : str ) -> None :
@@ -72,6 +73,11 @@ class CLIContext:
7273
7374
7475async def shutdown () -> None :
76+ global _is_shutting_down
77+ if _is_shutting_down :
78+ return
79+ _is_shutting_down = True
80+
7581 _logger .info ('Shutting down' )
7682 tasks = filter (lambda t : t != asyncio .current_task (), asyncio .all_tasks ())
7783 list (map (asyncio .Task .cancel , tasks ))
@@ -95,6 +101,12 @@ async def wrapper(*args, **kwargs) -> None:
95101 return wrapper
96102
97103
104+ def _sentry_before_send (event , _ ):
105+ if _is_shutting_down :
106+ return None
107+ return event
108+
109+
98110def init_sentry (config : DipDupConfig ) -> None :
99111 if not config .sentry :
100112 return
@@ -116,6 +128,7 @@ def init_sentry(config: DipDupConfig) -> None:
116128 integrations = integrations ,
117129 release = __version__ ,
118130 attach_stacktrace = attach_stacktrace ,
131+ before_send = _sentry_before_send ,
119132 )
120133
121134
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ async def __aenter__(self) -> None:
8080
8181 async def __aexit__ (self , exc_type , exc , tb ):
8282 """Close underlying aiohttp session"""
83- self ._logger .info ('Closing gateway session (%s)' , self ._url )
83+ self ._logger .debug ('Closing gateway session (%s)' , self ._url )
8484 await self .__session .close ()
8585
8686 @property
You can’t perform that action at this time.
0 commit comments