pike.git / lib / modules / Filesystem.pmod / Monitor.pmod / basic.pike

version» Context lines:

pike.git/lib/modules/Filesystem.pmod/Monitor.pmod/basic.pike:1:   //   // Basic filesystem monitor.   // - // $Id: basic.pike,v 1.31 2010/01/28 14:06:45 grubba Exp $ + // $Id: basic.pike,v 1.32 2010/01/28 14:19:52 grubba Exp $   //   // 2009-07-09 Henrik Grubbström   //      //! Basic filesystem monitor.   //!   //! This module is intended to be used for incremental scanning of   //! a filesystem.      //! The default maximum number of seconds between checks of directories
pike.git/lib/modules/Filesystem.pmod/Monitor.pmod/basic.pike:310:    int delta = max_dir_check_interval || global::max_dir_check_interval;    this_program::st = st;    if (!st || !st->isdir) {    delta *= file_interval_factor || global::file_interval_factor;    }    if (!next_poll) {    // Attempt to distribute polls evenly at startup.    delta = 1 + random(delta);    }    if (st) { -  int d = 1 + ((time(1) - st->mtime)>>4); +  int d = 1 + ((time(1) - st->mtime)>>8);    if (d < 0) d = max_dir_check_interval || global::max_dir_check_interval;    if (d < delta) delta = d; -  d = 1 + ((time(1) - st->ctime)>>4); +  d = 1 + ((time(1) - st->ctime)>>8);    if (d < 0) d = max_dir_check_interval || global::max_dir_check_interval;    if (d < delta) delta = d;    }    if (last_change <= time(1)) {    // Time until stable.    int d = last_change + (stable_time || global::stable_time) - time(1);    d >>= 1;    if (d < 0) d = 1;    if (d < delta) delta = d;    }