From 5e06310da1d04436a27354f3d305a520ce993c1d Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 6 Jul 2022 15:28:38 +0200 Subject: indexamajig: Add timeout for ZMQ socket --- src/im-sandbox.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/im-sandbox.c') diff --git a/src/im-sandbox.c b/src/im-sandbox.c index 5c4629ce..a9722509 100644 --- a/src/im-sandbox.c +++ b/src/im-sandbox.c @@ -452,14 +452,13 @@ static int run_work(const struct index_args *iargs, Stream *st, profile_start("zmq-fetch"); set_last_task(sb->shared->last_task[cookie], "ZMQ fetch"); - do { - pargs.zmq_data = im_zmq_fetch(zmqstuff, - &pargs.zmq_data_size); - } while ( pargs.zmq_data_size < 15 ); - ok = 1; - + pargs.zmq_data = im_zmq_fetch(zmqstuff, + &pargs.zmq_data_size); profile_end("zmq-fetch"); + if ( (pargs.zmq_data != NULL) + && (pargs.zmq_data_size > 15) ) ok = 1; + /* The filename/event, which will be 'fake' values in * this case, still came via the event queue. More * importantly, the event queue gave us a unique -- cgit v1.2.3