@@ -76,6 +76,7 @@ def on_success(datasets):
7676 datasets: `list` [`lsst.daf.butler.FileDataset`]
7777 The successfully-ingested datasets.
7878 """
79+ webhook_filenames = dict ()
7980 for dataset in datasets :
8081 logger .info ("Ingested %s" , dataset )
8182 info = Info .from_path (dataset .path .geturl ())
@@ -85,9 +86,13 @@ def on_success(datasets):
8586 pipe .hset (f"FILE:{ info .path } " , "ingest_time" , str (time .time ()))
8687 pipe .hincrby (f"INGEST:{ info .bucket } :{ info .instrument } " , f"{ info .obs_day } " , 1 )
8788 pipe .execute ()
88- if webhook_uri :
89- resp = requests .post (webhook_uri , json = info .__dict__ , timeout = 0.5 )
90- logger .info ("Webhook response: %s" , resp )
89+ if info .is_raw ():
90+ webhook_filenames .setdefault (info .exp_id , []).append (info .filename )
91+ if webhook_uri :
92+ for exp_id in webhook_filenames :
93+ info_dict = {"exp_id" : exp_id , "filenames" : webhook_filenames [exp_id ]}
94+ resp = requests .post (webhook_uri , json = info_dict , timeout = 0.5 )
95+ logger .info ("Webhook response %s: %s" , info_dict , resp )
9196
9297
9398def on_ingest_failure (dataset , exc ):
0 commit comments