diff --git a/conf_schema.h b/conf_schema.h index 21aee1b7..ac41acc3 100644 --- a/conf_schema.h +++ b/conf_schema.h @@ -398,6 +398,7 @@ END_STRUCT STRUCT(rhizome_api_restful) SUB_STRUCT(userlist, users,) ATOM(uint32_t, newsince_timeout, 60, uint32_time_interval,, "Time to block while reporting new bundles") +ATOM(uint32_t, newsince_poll_ms, 2000, uint32_nonzero,, "Database poll interval while blocked reporting new bundles") END_STRUCT STRUCT(rhizome_api) diff --git a/rhizome_http.c b/rhizome_http.c index fb885665..4b5f201f 100644 --- a/rhizome_http.c +++ b/rhizome_http.c @@ -474,7 +474,7 @@ static int restful_rhizome_bundlelist_json_content_chunk(sqlite_retry_state *ret r->u.list.phase = LIST_DONE; return 0; } - time_ms_t wake_at = now + 2000; + time_ms_t wake_at = now + config.rhizome.api.restful.newsince_poll_ms; if (wake_at > r->u.list.end_time) wake_at = r->u.list.end_time; http_request_pause_response(&r->http, wake_at); diff --git a/tests/rhizomehttp b/tests/rhizomehttp index 3b39fb57..b8566aac 100755 --- a/tests/rhizomehttp +++ b/tests/rhizomehttp @@ -240,6 +240,7 @@ doc_RhizomeNewSince="Fetch Rhizome bundle list since token in JSON format" setup_RhizomeNewSince() { setup executeOk_servald config set rhizome.api.restful.newsince_timeout 60s + executeOk_servald config set rhizome.api.restful.newsince_poll_ms 500 add_bundles 0 5 executeOk curl \ --silent --fail --show-error \