[xiph-commits] r15263 - icecast/trunk/icecast/src
karl at svn.xiph.org
karl at svn.xiph.org
Sun Sep 7 17:22:38 PDT 2008
Author: karl
Date: 2008-09-07 17:22:37 -0700 (Sun, 07 Sep 2008)
New Revision: 15263
Modified:
icecast/trunk/icecast/src/yp.c
Log:
have a minimum update duration to prevent very frequent touch updates, no
point in creating extra YP load for this case.
Modified: icecast/trunk/icecast/src/yp.c
===================================================================
--- icecast/trunk/icecast/src/yp.c 2008-09-05 23:29:19 UTC (rev 15262)
+++ icecast/trunk/icecast/src/yp.c 2008-09-08 00:22:37 UTC (rev 15263)
@@ -944,12 +944,9 @@
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 @@
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)
More information about the commits
mailing list