From 98953b1fc29a693aa797989402f7205523448408 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Tue, 12 Sep 2017 11:02:40 -0400 Subject: hs-v3: Rate limit some log statements Also fix an indentation issue. Closes #23480 Signed-off-by: David Goulet --- src/or/hs_service.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/or/hs_service.c') diff --git a/src/or/hs_service.c b/src/or/hs_service.c index 5759aa8127..a8883e03a0 100644 --- a/src/or/hs_service.c +++ b/src/or/hs_service.c @@ -2978,8 +2978,14 @@ hs_service_lists_fnames_for_sandbox(smartlist_t *file_list, void hs_service_dir_info_changed(void) { - log_info(LD_REND, "New dirinfo arrived: consider reuploading descriptor"); - consider_republishing_hs_descriptors = 1; + if (hs_service_get_num_services() > 0) { + /* New directory information usually goes every consensus so rate limit + * every 30 minutes to not be too conservative. */ + static struct ratelim_t dir_info_changed_ratelim = RATELIM_INIT(30 * 60); + log_fn_ratelim(&dir_info_changed_ratelim, LOG_INFO, LD_REND, + "New dirinfo arrived: consider reuploading descriptor"); + consider_republishing_hs_descriptors = 1; + } } /* Called when we get an INTRODUCE2 cell on the circ. Respond to the cell and -- cgit v1.2.3-54-g00ecf