Commit 063c3d63 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(last_start): Static variable removed.

(garb_text): Expect the caller to wait long enough when the garb
	shouldn't be running.  Return true when the garb is completed,
	instead of when the garb shouldn't be running.
parent 252885fa
/*
* $Id: text-garb.c,v 0.42 2002/03/29 22:38:02 ceder Exp $
* $Id: text-garb.c,v 0.43 2003/07/12 00:19:34 ceder Exp $
* Copyright (C) 1991-1995, 1997-2002 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -96,7 +96,6 @@ BUGDECL;
*/
static Text_no last_checked = 0;
static time_t last_start = NO_TIME;
/*
* Delete old texts.
......@@ -121,16 +120,7 @@ garb_text(void)
return TRUE;
if ( last_checked == 0 )
{
if ( last_start != NO_TIME
&& ldifftime(current_time, last_start) < param.garb_interval * 60 )
{
return TRUE;
}
kom_log("MSG: garb started.\n");
last_start = current_time;
}
tell_cache_garb_text(1);
last_checked = traverse_text( last_checked );
......@@ -144,7 +134,7 @@ garb_text(void)
async_garb_ended(deleted_texts);
#endif
deleted_texts = 0;
return FALSE;
return TRUE;
}
if ( (text_s = cached_get_text_stat( last_checked )) == NULL )
......@@ -236,7 +226,6 @@ start_garb(void)
CHK_CONNECTION(FAILURE);
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