Branch: Tag:

2007-01-17

2007-01-17 12:45:26 by Jonas Wallden <jonasw@roxen.com>

Earlier fix for OPTIMIZE TABLE in ImageCache was oblivious to the fact that
restarting the cimg module reset the timer and triggered an immediate db
operation. We now preserve the cache object instance if possible. [RT#8705]
and [RT#8707].

Rev: server/modules/graphics/cimg.pike:1.75

7:      roxen.ImageCache the_cache;    - constant cvs_version = "$Id: cimg.pike,v 1.74 2006/10/05 09:02:25 jonasw Exp $"; + constant cvs_version = "$Id: cimg.pike,v 1.75 2007/01/17 12:45:26 jonasw Exp $";   constant module_type = MODULE_TAG;   constant module_name = "Graphics: Image converter";   constant module_doc = "Provides the tag <tt>&lt;cimg&gt;</tt> that can be used "
148:      void start()   { +  // Reuse previous cache object if possible +  if (the_cache) { +  // Update reference to callback function in case we've been reloaded +  the_cache->set_draw_function(generate_image); +  } else {    the_cache = roxen.ImageCache( "cimg", generate_image ); -  +  }    do_ext = query("ext");   }    -  + void stop() + { +  // Force cache object to be recreated in start() +  the_cache = 0; + } +    mapping(string:function) query_action_buttons() {    return ([ "Clear Cache":flush_cache ]);   }