peal.web.jobs.latest_activity

peal.web.jobs.latest_activity(log_path, tail_bytes=16000, max_chars=240)[source]

The last meaningful line of a job log, for the “currently” display.

tqdm redraws its bar with carriage returns, so only the last segment of a line is kept. The adaptor’s long Loading config from ... dumps and the worker’s own command line are skipped.

Parameters:
  • log_path (str) – Path of the job’s log.txt.

  • tail_bytes (int) – How much of the end of the log to look at.

  • max_chars (int) – Longer lines are cut to this length.

Returns:

The line, or None when the log is missing or has nothing to show.

Return type:

str or None