diff --git a/mobilizon_reshare/main/start.py b/mobilizon_reshare/main/start.py index 5c9eac0..58941d4 100644 --- a/mobilizon_reshare/main/start.py +++ b/mobilizon_reshare/main/start.py @@ -44,7 +44,7 @@ async def start(): ) if event: - logger.debug(f"Event to publish found: {event.name}") + logger.info(f"Event to publish found: {event.name}") models = await create_event_publication_models(event) publications = list(EventPublication.from_orm(m, event) for m in models) @@ -55,4 +55,4 @@ async def start(): if not report.succesful: PublicationFailureNotifiersCoordinator(report,).notify_failure() else: - logger.debug("No event to publish found") + logger.info("No event to publish found") diff --git a/mobilizon_reshare/publishers/coordinator.py b/mobilizon_reshare/publishers/coordinator.py index a830f3e..f1b7b30 100644 --- a/mobilizon_reshare/publishers/coordinator.py +++ b/mobilizon_reshare/publishers/coordinator.py @@ -82,6 +82,7 @@ class PublisherCoordinator: for publication in self.publications: try: + logger.info(f"Publishing to {publication.publisher.name}") message = publication.formatter.get_message_from_event( publication.event ) @@ -94,6 +95,7 @@ class PublisherCoordinator: ) ) except PublisherError as e: + logger.error(str(e)) reports.append( EventPublicationReport( status=PublicationStatus.FAILED, diff --git a/mobilizon_reshare/storage/db.py b/mobilizon_reshare/storage/db.py index 7f0b289..0374f60 100644 --- a/mobilizon_reshare/storage/db.py +++ b/mobilizon_reshare/storage/db.py @@ -41,13 +41,5 @@ class MoReDB: await update_publishers(publisher_names) -@atexit.register -def gracefully_tear_down(): - logger.info("Shutting down DB") - loop = asyncio.new_event_loop() - asyncio.set_event_loop(loop) - asyncio.run(tear_down()) - - async def tear_down(): return await Tortoise.close_connections()