Browse Source

MT#55283 scale falloff

Change-Id: Iab3a3bff3f32561166f9c3076125103c29b5ab1f
pull/1938/head
Richard Fuchs 8 months ago
parent
commit
8e5cd0aa9d
1 changed files with 8 additions and 8 deletions
  1. +8
    -8
      recording-daemon/notify.c

+ 8
- 8
recording-daemon/notify.c View File

@ -13,7 +13,7 @@ struct notif_req {
int64_t retry_time; int64_t retry_time;
unsigned int retries; unsigned int retries;
unsigned int falloff;
int64_t falloff_us;
}; };
@ -143,17 +143,17 @@ fail:
req->retries++; req->retries++;
if (c) if (c)
ilog(LOG_DEBUG, "Failed to perform HTTP notification for '%s%s%s': " ilog(LOG_DEBUG, "Failed to perform HTTP notification for '%s%s%s': "
"Error while %s: %s. Will retry in %u seconds (#%u)",
"Error while %s: %s. Will retry in %" PRId64 " seconds (#%u)",
FMT_M(req->name), FMT_M(req->name),
err, curl_easy_strerror(ret), err, curl_easy_strerror(ret),
req->falloff, req->retries);
req->falloff_us / 1000000L, req->retries);
else else
ilog(LOG_DEBUG, "Failed to perform HTTP notification for '%s%s%s': " ilog(LOG_DEBUG, "Failed to perform HTTP notification for '%s%s%s': "
"Failed to create CURL object. Will retry in %u seconds (#%u)",
"Failed to create CURL object. Will retry in %" PRId64 " seconds (#%u)",
FMT_M(req->name), FMT_M(req->name),
req->falloff, req->retries);
req->retry_time = now_us() + req->falloff * 1000000L; // XXX scale to micro
req->falloff *= 2;
req->falloff_us / 1000000L, req->retries);
req->retry_time = now_us() + req->falloff_us;
req->falloff_us *= 2;
pthread_mutex_lock(&timer_lock); pthread_mutex_lock(&timer_lock);
g_tree_insert(notify_timers, req, req); g_tree_insert(notify_timers, req, req);
@ -320,7 +320,7 @@ void notify_push_output(output_t *o, metafile_t *mf, tag_t *tag) {
notify_add_header(req, "X-Recording-Tag-Metadata: %s", tag->metadata); notify_add_header(req, "X-Recording-Tag-Metadata: %s", tag->metadata);
} }
req->falloff = 5; // initial retry time
req->falloff_us = 5000000LL; // initial retry time
g_thread_pool_push(notify_threadpool, req, NULL); g_thread_pool_push(notify_threadpool, req, NULL);
} }

Loading…
Cancel
Save