aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-06-22 21:45:38 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-06-23 10:57:38 +0100
commitd17ea56136824abb4ca406d3902e75cebeefc812 (patch)
tree2b71bb4d9e43e836bfa34c2fe95c7e44f13e387f /src
parentf2228a7422aa8f379efb4e20d117b2d1c2a65b56 (diff)
downloadrspamd-d17ea56136824abb4ca406d3902e75cebeefc812.tar.gz
rspamd-d17ea56136824abb4ca406d3902e75cebeefc812.zip
Return previous learn counts in sqlite3 backend.
Diffstat (limited to 'src')
-rw-r--r--src/libstat/backends/sqlite3_backend.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libstat/backends/sqlite3_backend.c b/src/libstat/backends/sqlite3_backend.c
index 5a791b6aa..12079196f 100644
--- a/src/libstat/backends/sqlite3_backend.c
+++ b/src/libstat/backends/sqlite3_backend.c
@@ -564,12 +564,14 @@ rspamd_sqlite3_inc_learns (gpointer runtime,
gpointer ctx)
{
struct rspamd_stat_sqlite3_db *bk = runtime;
+ guint64 res;
g_assert (bk != NULL);
+ rspamd_sqlite3_run_prstmt (bk, RSPAMD_STAT_BACKEND_GET_LEARNS, &res);
rspamd_sqlite3_run_prstmt (bk, RSPAMD_STAT_BACKEND_INC_LEARNS,
SQLITE3_DEFAULT, SQLITE3_DEFAULT);
- return 0;
+ return res;
}
gulong
@@ -577,12 +579,14 @@ rspamd_sqlite3_dec_learns (gpointer runtime,
gpointer ctx)
{
struct rspamd_stat_sqlite3_db *bk = runtime;
+ guint64 res;
g_assert (bk != NULL);
+ rspamd_sqlite3_run_prstmt (bk, RSPAMD_STAT_BACKEND_GET_LEARNS, &res);
rspamd_sqlite3_run_prstmt (bk, RSPAMD_STAT_BACKEND_DEC_LEARNS,
SQLITE3_DEFAULT, SQLITE3_DEFAULT);
- return 0;
+ return res;
}
gulong