Roxen.git/
server/
base_server/
roxen.pike
Branch:
Tag:
Non-build tags
All tags
No tags
2001-08-10
2001-08-10 11:28:22 by Per Hedbor <ph@opera.com>
3548019f7a15dc838233a4bbe5c0338896de473e (
32
lines) (+
23
/-
9
)
[
Show
|
Annotate
]
Branch:
5.2
Removed some debug
Rev: server/base_server/roxen.pike:1.692
6:
// 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.
691
2001/08/
09
12
:
49
:
59
per Exp $";
+
constant cvs_version="$Id: roxen.pike,v 1.
692
2001/08/
10
11
:
28
:
22
per Exp $";
// The argument cache. Used by the image cache. ArgCache argcache;
2566:
//! <pi>time()</pi>) is provided, only images with their latest access before //! that time are flushed. {
-
report_debug("Cleaning "+name+" image cache.
\n
");
+
int num;
+
#ifdef DEBUG
+
int t = gethrtime();
+
report_debug("Cleaning "+name+" image cache
.
..
");
+
#endif
meta_cache = ([]); uid_cache = ([]); rst_cache = ([]); if( !age ) { QUERY( "DELETE FROM "+name );
-
+
num = -1;
return; } array(string) ids = QUERY( "SELECT id FROM "+name+" WHERE atime < "+age)->id;
-
+
num = sizeof( ids );
+
int q; while(q<sizeof(ids)) { string list = ids[q..q+99] * "','";
2586:
QUERY( "DELETE FROM "+name+" WHERE id in ('"+list+"')" ); }
+
if( num )
catch { // Old versions of Mysql lacks OPTIMIZE. Not that we support
2595:
}; meta_cache = ([]);
+
#ifdef DEBUG
+
report_debug("%s removed, %dms\n",
+
(num==-1?"all":num?(string)num:"no"),
+
(gethrtime()-t)/1000);
+
#endif
} array(int) status(int|void age)