fix: shutdown posthog after job (#31819)
* fix: change log level A duplicate existing job is often a cause of concern. * fix: avoid waiting indefinitely in long-living processes
This commit is contained in:
parent
c5f79016eb
commit
5eabc7ebac
2 changed files with 3 additions and 3 deletions
|
|
@ -115,7 +115,7 @@ def enqueue(
|
|||
frappe.throw(_("`job_id` paramater is required for deduplication."))
|
||||
job = get_job(job_id)
|
||||
if job and job.get_status(refresh=False) in (JobStatus.QUEUED, JobStatus.STARTED):
|
||||
frappe.logger().debug(f"Not queueing job {job.id} because it is in queue already")
|
||||
frappe.logger().error(f"Not queueing job {job.id} because it is in queue already")
|
||||
return
|
||||
elif job:
|
||||
# delete job to avoid argument issues related to job args
|
||||
|
|
@ -725,7 +725,7 @@ def flush_telemetry():
|
|||
to push events."""
|
||||
ph = getattr(frappe.local, "posthog", None)
|
||||
with suppress(Exception):
|
||||
ph and ph.flush()
|
||||
ph and ph.shutdown()
|
||||
|
||||
|
||||
def _check_queue_size(q: Queue):
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ def init_telemetry():
|
|||
return
|
||||
|
||||
with suppress(Exception):
|
||||
frappe.local.posthog = Posthog(posthog_project_id, host=posthog_host)
|
||||
frappe.local.posthog = Posthog(posthog_project_id, host=posthog_host, timeout=5, max_retries=3)
|
||||
|
||||
|
||||
def capture(event, app, **kwargs):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue