Roxen.git / server / base_server / roxen.pike

version» Context lines:

Roxen.git/server/base_server/roxen.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2004, Roxen IS.   //   // The Roxen WebServer main program.   //   // Per Hedbor, Henrik Grubbström, Pontus Hagland, David Hedbor and others.   // ABS and suicide systems contributed freely by Francesco Chemolli    - constant cvs_version="$Id: roxen.pike,v 1.892 2006/01/11 06:12:41 mast Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.893 2006/01/26 13:54:53 jonasw Exp $";      //! @appears roxen   //!   //! The Roxen WebServer main program.      // The argument cache. Used by the image cache.   ArgCache argcache;      // Some headerfiles   #define IN_ROXEN
Roxen.git/server/base_server/roxen.pike:3469:    }       static void init_db( )    {    catch(sync_meta());    setup_tables();    }       void do_cleanup( )    { -  background_run( 3600*10+random(4711), do_cleanup ); -  flush(time()-7*3600*24); +  // Flushes may be costly in large sites (at least the OPTIMIZE TABLE +  // command) so schedule next run sometime after 04:30 the day after +  // tomorrow. +  int now = time(); +  mapping info = localtime(now); +  int wait = (int) ((24 - info->hour) + 24 + 4.5) * 3600 + random(500); +  background_run(wait, do_cleanup); +  +  // Remove items older than one week +  flush(now - 7 * 3600 * 24);    }       void create( string id, function draw_func )    //! Instantiate an image cache of your own, whose image files will    //! be stored in a table `id' in the cache mysql database,    //!    //! The `draw_func' callback passed will be responsible for    //! (re)generation of the images in the cache. Your draw callback    //! may take any arguments you want, depending on the first argument    //! you give the <ref>store()</ref> method, but its final argument