mapper-wait: increase polling speed
5 seconds is a really long time for one daemon to be waiting for
another to start up. Decrease the polling interval to 1s and increase
the number of retries correspondingly.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Id27bfbe22c566b3aa057d4692778d6c0244722c1
diff --git a/libmapper/app.c b/libmapper/app.c
index c8b4f20..b8639f8 100644
--- a/libmapper/app.c
+++ b/libmapper/app.c
@@ -34,7 +34,7 @@
sd_event* loop = NULL;
mapper_async_wait* wait = NULL;
size_t attempts = 0;
- const size_t max_attempts = 4;
+ const size_t max_attempts = 20;
if (argc < 3)
{
@@ -93,8 +93,8 @@
{
if (attempts <= max_attempts)
{
- fprintf(stderr, "Retrying in 5s\n");
- sleep(5);
+ fprintf(stderr, "Retrying in 1s\n");
+ sleep(1);
sd_event_unref(loop);
sd_bus_unref(conn);
continue;