Commit 30836f31 authored by Karl Heyes's avatar Karl Heyes

have a minimum update duration to prevent very frequent touch updates, no

point in creating extra YP load for this case.

svn path=/icecast/trunk/icecast/; revision=15263
parent d9723325
......@@ -944,12 +944,9 @@ void yp_remove (const char *mount)
void yp_touch (const char *mount)
{
struct yp_server *server = (struct yp_server *)active_yps;
time_t trigger;
ypdata_t *search_list = NULL;
thread_rwlock_rlock (&yp_lock);
/* do update in 3 secs, give stats chance to update */
trigger = time(NULL) + 3;
if (server)
search_list = server->mounts;
......@@ -964,9 +961,9 @@ void yp_touch (const char *mount)
search_list = yp->next;
continue;
}
/* only force if touch */
if (yp->process == do_yp_touch)
yp->next_update = trigger;
/* don't update the directory if there is a touch scheduled soon */
if (yp->process == do_yp_touch && now + yp->touch_interval - yp->next_update > 60)
yp->next_update = now + 3;
}
server = server->next;
if (server)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment