s/Application.stop_app/Application.stop/g

This commit is contained in:
Fabio Manganiello 2023-08-13 22:23:15 +02:00
parent 827b564006
commit 1819ee75ef
Signed by: blacklight
GPG key ID: D90FBA7F76362774
2 changed files with 6 additions and 4 deletions

View file

@ -348,7 +348,7 @@ class Application:
self.requests_to_process self.requests_to_process
and self.processed_requests >= self.requests_to_process and self.processed_requests >= self.requests_to_process
): ):
self.stop_app() self.stop()
elif isinstance(msg, Response): elif isinstance(msg, Response):
msg.log() msg.log()
elif isinstance(msg, Event): elif isinstance(msg, Event):
@ -357,10 +357,12 @@ class Application:
return _f return _f
def stop_app(self): def stop(self):
"""Stops the backends and the bus.""" """Stops the backends and the bus."""
from .plugins import RunnablePlugin from .plugins import RunnablePlugin
log.info('Stopping the application')
if self.backends: if self.backends:
for backend in self.backends.values(): for backend in self.backends.values():
backend.stop() backend.stop()
@ -426,7 +428,7 @@ class Application:
except KeyboardInterrupt: except KeyboardInterrupt:
log.info('SIGINT received, terminating application') log.info('SIGINT received, terminating application')
finally: finally:
self.stop_app() self.stop()
def main(*args: str): def main(*args: str):

View file

@ -45,7 +45,7 @@ def app():
yield _app yield _app
logging.info('Stopping Platypush test service') logging.info('Stopping Platypush test service')
_app.stop_app() _app.stop()
clear_loggers() clear_loggers()
db = (Config.get('main.db') or {}).get('engine', '')[len('sqlite:///') :] db = (Config.get('main.db') or {}).get('engine', '')[len('sqlite:///') :]