Enhance job logging by adding current job state information and improve error handling in job calculations

This commit is contained in:
2025-01-07 21:58:49 +01:00
parent 3503c24f20
commit 90b934107b
2 changed files with 24 additions and 14 deletions

View File

@ -27,6 +27,7 @@ def calculate(job: Job) -> str:
)
if trigger_time is None:
logger.error("Couldn't calculate time for job: %s: %s", job.id, job.name)
logger.error("State: %s", job.__getstate__() if hasattr(job, "__getstate__") else "No state")
return "Couldn't calculate time"
return f"<t:{int(trigger_time.timestamp())}:R>"