feat(queue_monitor): Add monitoring tasks for the dataset queue.

pull/20647/head
Dongyu Li 12 months ago
parent 995676e613
commit fb183205d1

@ -49,14 +49,14 @@ def queue_monitor_task():
threshold=threshold,
alert_time=current_time,
)
mail.send(to=to,
subject="Alert: Dataset Queue pending tasks exceeded the limit",
html=html_content)
mail.send(
to=to, subject="Alert: Dataset Queue pending tasks exceeded the limit", html=html_content
)
except Exception as e:
logging.exception(click.style(f"Exception occurred during sending email", fg="red"))
logging.exception(click.style("Exception occurred during sending email", fg="red"))
except Exception as e:
logging.exception(click.style(f"Exception occurred during queue monitoring", fg="red"))
logging.exception(click.style("Exception occurred during queue monitoring", fg="red"))
finally:
if db.session.is_active:
db.session.close()

Loading…
Cancel
Save