Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FP hists in broker mode: don't send unsaved #287

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions kowalski/alert_brokers/alert_broker_ztf.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ def process_alert(alert: Mapping, topic: str):
< 30
):
alert_aux["fp_hists"] = fp_hists
else:
# if we don't save it, empty the fp_hists array to not send to SkyPortal what is not saved here.
fp_hists = []

with timer(f"Aux ingesting {object_id} {candid}", alert_worker.verbose > 1):
retry(alert_worker.mongo.insert_one)(
Expand Down Expand Up @@ -184,6 +187,10 @@ def process_alert(alert: Mapping, topic: str):
== 1
):
fp_hists = alert_worker.update_fp_hists(alert, fp_hists)
else:
# if there is no fp_hists for this object, we don't update anything
# and we empty the fp_hists array to not send to SkyPortal what is not saved here.
fp_hists = []

if config["misc"]["broker"]:
# execute user-defined alert filters
Expand Down
Loading