mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-02-02 15:07:36 -05: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:
parent
d97233258c
commit
30836f31c9
9
src/yp.c
9
src/yp.c
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user