fixed bug when submitting stats

This commit is contained in:
ps 2011-01-08 16:24:33 +00:00
parent 98989ab0b8
commit a5ee8d8885
3 changed files with 16 additions and 1 deletions

View file

@ -1,10 +1,17 @@
ChangeLog ChangeLog
--------- ---------
2011-01-08 17:22 Juan José Gutiérrez de Quevedo <juanjo@gutierrezdequevedo.com>
* fixed small bug when submitting stats that would stop the thread that
submits them
2011-01-08 02:27 Juan José Gutiérrez de Quevedo <juanjo@gutierrezdequevedo.com> 2011-01-08 02:27 Juan José Gutiérrez de Quevedo <juanjo@gutierrezdequevedo.com>
* revamped logging system. hopefully, messages will be more informative now * revamped logging system. hopefully, messages will be more informative now
2011-01-06 23:53 Juan José Gutiérrez de Quevedo <juanjo@gutierrezdequevedo.com> 2011-01-06 23:53 Juan José Gutiérrez de Quevedo <juanjo@gutierrezdequevedo.com>
* development restarted * development restarted

View file

@ -429,6 +429,7 @@ unsigned long Database::cleanDB()
} }
catch(Exception &e) catch(Exception &e)
{ {
LERR(e);
doQuery("ROLLBACK TRANSACTION"); doQuery("ROLLBACK TRANSACTION");
} }

View file

@ -278,7 +278,14 @@ void *cleaner_thread_run(void *)
{ {
unsigned long spamcount; unsigned long spamcount;
try
{
spamcount=db.cleanDB(); spamcount=db.cleanDB();
}
catch(Exception &e)
{
LERR("Error cleaning the database: " + string(e));
}
LDEB("Cleaning database, cleaning "+Utils::inttostr(spamcount)+" blocked spams."); LDEB("Cleaning database, cleaning "+Utils::inttostr(spamcount)+" blocked spams.");
if(spamcount>0&&cfg.getSubmitStats()) if(spamcount>0&&cfg.getSubmitStats())
{ {