From a5ee8d88859d1b5f2220b060dd02ad663628d40d Mon Sep 17 00:00:00 2001 From: ps Date: Sat, 8 Jan 2011 16:24:33 +0000 Subject: [PATCH] fixed bug when submitting stats --- ChangeLog | 7 +++++++ src/Database.cpp | 1 + src/hermes.cpp | 9 ++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7a02d48..14cfcbf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,17 @@ ChangeLog --------- +2011-01-08 17:22 Juan José Gutiérrez de Quevedo + +* 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 * revamped logging system. hopefully, messages will be more informative now + 2011-01-06 23:53 Juan José Gutiérrez de Quevedo * development restarted diff --git a/src/Database.cpp b/src/Database.cpp index 6af1444..dc10935 100644 --- a/src/Database.cpp +++ b/src/Database.cpp @@ -429,6 +429,7 @@ unsigned long Database::cleanDB() } catch(Exception &e) { + LERR(e); doQuery("ROLLBACK TRANSACTION"); } diff --git a/src/hermes.cpp b/src/hermes.cpp index 6bb2253..c1d6cf3 100644 --- a/src/hermes.cpp +++ b/src/hermes.cpp @@ -278,7 +278,14 @@ void *cleaner_thread_run(void *) { unsigned long spamcount; - spamcount=db.cleanDB(); + try + { + spamcount=db.cleanDB(); + } + catch(Exception &e) + { + LERR("Error cleaning the database: " + string(e)); + } LDEB("Cleaning database, cleaning "+Utils::inttostr(spamcount)+" blocked spams."); if(spamcount>0&&cfg.getSubmitStats()) {