Roxen.git / server / base_server / roxen.pike

version» Context lines:

Roxen.git/server/base_server/roxen.pike:4553:    }       void flush(int|void age)    //! Flush the cache. If an age (an integer as returned by    //! @[time()]) is provided, only images with their latest access before    //! that time are flushed.    {    int num;   #if defined(DEBUG) || defined(IMG_CACHE_DEBUG)    int t = gethrtime(); -  report_debug("Cleaning "+name+" image cache ... "); +    #endif    sync_meta();    uid_cache = ([]);    rst_cache = ([]);    if( !age )    { -  +  QUERY( "DELETE FROM "+name );   #if defined(DEBUG) || defined(IMG_CACHE_DEBUG) -  report_debug("cleared\n"); +  int msec = (gethrtime() - t) / 1000; +  report_debug("Image cache %s emptied (%dms).\n", name, msec);   #endif -  QUERY( "DELETE FROM "+name ); +     num = -1;    return;    }       array(string) ids =    QUERY( "SELECT id FROM "+name+" WHERE atime < "+age)->id;       num = sizeof( ids );       int q;
Roxen.git/server/base_server/roxen.pike:4600: Inside #if 0
   // them, really, but it might be nice not to throw an error, at    // least.   #if defined(DEBUG) || defined(IMG_CACHE_DEBUG)    report_debug("Optimizing database ... ", name);   #endif    QUERY( "OPTIMIZE TABLE "+name );    };   #endif      #if defined(DEBUG) || defined(IMG_CACHE_DEBUG) -  report_debug("%s removed (%dms)\n", -  (num==-1?"all":num?(string)num:"none"), -  (gethrtime()-t)/1000); +  int msec = (gethrtime() - t) / 1000; +  if (num || (msec > 500)) { +  report_debug("Image cache %s cleaned: %s removed (%dms)\n", +  name, +  (num == -1 ? "all" : num ? (string) num : "none"), msec); +  }   #endif    }       array(int) status(int|void age)    //! Return the total number of images in the cache, their cumulative    //! sizes in bytes and, if an age time_t was supplied, the number of    //! images that has not been accessed after that time is returned    //! (see <ref>flush()</ref>). (Three integers are returned    //! regardless of whether an age parameter was given.)    {