From ca77de46b42713993b1cfb18e9a30de522d8a69e Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sat, 3 Jun 2023 17:58:41 +0200 Subject: ASAP::O: Use unique filename for hits --- src/im-asapo.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/im-asapo.c b/src/im-asapo.c index 16bd328f..4d483669 100644 --- a/src/im-asapo.c +++ b/src/im-asapo.c @@ -283,17 +283,20 @@ static void send_real(struct im_asapo *a, struct image *image) { AsapoMessageHeaderHandle header; AsapoErrorHandle err; + char filename[1024]; - err = asapo_new_handle(); + snprintf(filename, 1024, "processed/%s_hits/%s-%i.data", + a->stream, a->stream, image->serial); header = asapo_create_message_header(image->serial, image->data_block_size, - image->filename, + filename, image->meta_data, 0, /* Dataset substream */ 0, 0); /* Auto ID */ + err = asapo_new_handle(); asapo_producer_send(a->producer, header, image->data_block, kDefaultIngestMode, a->stream, send_callback, &err); @@ -313,17 +316,20 @@ static void send_placeholder(struct im_asapo *a, struct image *image) { AsapoMessageHeaderHandle header; AsapoErrorHandle err; + char filename[1024]; - err = asapo_new_handle(); + snprintf(filename, 1024, "processed/%s_hits/%s-%i.placeholder", + a->stream, a->stream, image->serial); header = asapo_create_message_header(image->serial, 8, /* strlen("SKIPPED"+\0) */ - image->filename, + filename, image->meta_data, 0, /* Dataset substream */ 0, 0); /* Auto ID */ + err = asapo_new_handle(); asapo_producer_send(a->producer, header, "SKIPPED", kDefaultIngestMode, a->stream, send_callback, &err); -- cgit v1.2.3