Add 'rhizome.api.restful.newsince_poll_ms' config option

This commit is contained in:
Andrew Bettison 2013-11-20 14:50:57 +10:30
parent 833466411c
commit 29fab6dcb7
3 changed files with 3 additions and 1 deletions

View File

@ -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)

View File

@ -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);

View File

@ -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 \