/*
 * Copyright (c) 2004-2008 Darron M Broad
 * All rights reserved.
 *
 * Licensed under the terms of the GPL3 license, see file COPYING for details.
 */

#include "cleaner.h"

/*
 * Cleaner class methods
 */

/*
 * the thread
 */
int
Cleaner::thread(void)
{
	try
	{
		Sqlite *db= new Sqlite(argv[1]);
		while(true)
		{
			sleep(60);
			db->SQLcommand( CLEANER_DELETE );
			db->SQLcommand( CLEANER_UPDATE );
		}
	}
	catch (const char *exception)
	{
		cout << "Cleaner: exception: " << exception << endl;
		exit( EX_SOFTWARE );
	}
	return 0;
}
