Skip to content

Commit

Permalink
Fix record handler output when running in manual mode.
Browse files Browse the repository at this point in the history
Other:
* Use new pre-trained model for synthetics integ tests.
* Add test for record handler in manual mode.
GitOrigin-RevId: 52b658e5ff8e9223e53296e2dc3a5329426be355
  • Loading branch information
pimlock committed Sep 14, 2021
1 parent 73f3e9f commit 02009e5
Show file tree
Hide file tree
Showing 5 changed files with 258 additions and 422 deletions.
4 changes: 2 additions & 2 deletions src/gretel_client/cli/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,10 @@ def _cleanup(self, sig, frame):
self.exit(1)
else:
self._shutting_down = True
self.log.warn("Got interupt signal.")
self.log.warn("Got interrupt signal.")

if self.cleanup_methods:
self.log.warn("Attemping graceful shutdown")
self.log.warn("Attempting graceful shutdown")
for method in self.cleanup_methods:
try:
method()
Expand Down
5 changes: 3 additions & 2 deletions src/gretel_client/cli/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,14 @@ def create_and_run_record_handler(
sc.register_cleanup(lambda: record_handler.cancel())
sc.log.info(f"Record handler created {record_handler.record_id}")

printable_record_handler = data.print_obj
if runner == RunnerMode.MANUAL.value:
# With --runner MANUAL, we only print the worker_key and it's up to the user to run the worker
sc.print(
data={"record_handler": data, "worker_key": record_handler.worker_key}
data={"record_handler": printable_record_handler, "worker_key": record_handler.worker_key}
)
else:
sc.print(data=data.print_obj)
sc.print(data=printable_record_handler)
except Exception as ex:
sc.log.error("Could not create record handler", ex=ex)
sc.exit(1)
Expand Down
Loading

0 comments on commit 02009e5

Please sign in to comment.