1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-09-22 04:15:54 -04:00

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
This commit is contained in:
Karl Heyes 2008-09-08 00:22:37 +00:00
parent d97233258c
commit 30836f31c9

View File

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