Commit 333945ac authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(last_checked): Moved to file-level scope, so that start_garb can access it.

(last_start): Likewise.
(garb_text): Send async-garb-ended when the garb ends, but only if
	DEBUG_CALLS is defined.
(start_garb): New function, only  present when DEBUG_CALLS is defined.
parent 5b67e499
/*
* $Id: text-garb.c,v 0.29 1999/05/24 09:34:41 ceder Exp $
* $Id: text-garb.c,v 0.30 1999/05/30 09:28:07 ceder Exp $
* Copyright (C) 1991-1995, 1997-1999 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -34,7 +34,7 @@
#endif
static const char *
rcsid = "$Id: text-garb.c,v 0.29 1999/05/24 09:34:41 ceder Exp $";
rcsid = "$Id: text-garb.c,v 0.30 1999/05/30 09:28:07 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -44,6 +44,9 @@ USE(rcsid);
#ifdef HAVE_STDARG_H
# include <stdarg.h>
#endif
#ifdef DEBUG_CALLS
# include <setjmp.h>
#endif
#include "ldifftime.h"
#include "s-string.h"
......@@ -57,6 +60,13 @@ USE(rcsid);
#include "internal-services.h"
#include "param.h"
#include "server-time.h"
#ifdef DEBUG_CALLS
# include "com.h"
# include "async.h"
# include "connections.h"
# include "send-async.h"
# include "services.h"
#endif
BUGDECL;
......@@ -93,6 +103,9 @@ BUGDECL;
* 5) Deallocate the bitmap and wait 24 hours.
*/
static Text_no last_checked = 0;
static time_t last_start = NO_TIME;
/*
* Delete old texts.
*
......@@ -104,8 +117,6 @@ BUGDECL;
Bool
garb_text(void)
{
static Text_no last_checked = 0;
static time_t last_start = NO_TIME;
static long deleted_texts = 0;
Text_stat *text_s;
......@@ -134,9 +145,13 @@ garb_text(void)
if ( last_checked == 0 )
{
kom_log("MSG: garb ready. %lu texts deleted.\n", (u_long)deleted_texts);
kom_log("MSG: garb ready. %lu texts deleted.\n",
(u_long)deleted_texts);
deleted_texts = 0;
tell_cache_garb_text(0);
#ifdef DEBUG_CALLS
async_garb_ended(deleted_texts);
#endif
return FALSE;
}
......@@ -248,3 +263,13 @@ garb_text(void)
return FALSE;
}
#ifdef DEBUG_CALLS
Success
start_garb(void)
{
kom_log("MSG: garb restarted.\n");
last_checked = 0;
last_start = NO_TIME;
return OK;
}
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment