Skip to content

Commit

Permalink
fix: wrap every report in a start/stop doc
Browse files Browse the repository at this point in the history
  • Loading branch information
maffettone committed Apr 8, 2024
1 parent 088cef6 commit b0f22db
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pdf_agents/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@ def tell(self, x, y) -> Dict[str, ArrayLike]:

class PDFReporterMixin:
"""Mixin for sending reports to Kafka as well as Tiled.
This wraps every report in a single run because downstream agents operate per-run instead of per-event.
This behavior is similar to the pdfstream service.
Parameters
----------
Expand All @@ -357,6 +359,7 @@ def generate_report(self, **kwargs):
uid = self._write_event("report", doc)
self._report_producer("report", doc)
logger.info(f"Generated report. Tiled: {uid}\n Kafka: {doc.get('uid', 'No UID')}")
self.close_and_restart(clear_tell_cache=False, retell_all=False, reason="Per-Run Subscribers")

@classmethod
def get_beamline_objects(cls) -> dict:
Expand Down

0 comments on commit b0f22db

Please sign in to comment.