struct rspamd_fuzzy_storage_ctx *ctx = worker->ctx;
GError *err = NULL;
gdouble next_check;
+ struct event usr2_
ctx->ev_base = rspamd_prepare_worker (worker,
"fuzzy",
server_stat = worker->srv->stat;
- if ((ctx->backend = rspamd_fuzzy_backend_open (ctx->hashfile, &err)) == NULL) {
+ /*
+ * Open DB and perform VACUUM
+ */
+ if ((ctx->backend = rspamd_fuzzy_backend_open (ctx->hashfile, TRUE, &err)) == NULL) {
msg_err ("cannot open backend: %e", err);
g_error_free (err);
exit (EXIT_SUCCESS);
return bk;
}
-struct rspamd_fuzzy_backend*
-rspamd_fuzzy_backend_open (const gchar *path, GError **err)
+struct rspamd_fuzzy_backend *
+rspamd_fuzzy_backend_open (const gchar *path,
+ gboolean vacuum,
+ GError **err)
{
gchar *dir;
gint fd;
sqlite3_errmsg (backend->db));
}
- rspamd_fuzzy_backend_run_simple (RSPAMD_FUZZY_BACKEND_VACUUM, backend, NULL);
+ if (vacuum) {
+ rspamd_fuzzy_backend_run_simple (RSPAMD_FUZZY_BACKEND_VACUUM,
+ backend,
+ NULL);
+ }
if (rspamd_fuzzy_backend_run_stmt (backend, RSPAMD_FUZZY_BACKEND_COUNT)
== SQLITE_OK) {
* @param err error pointer
* @return backend structure or NULL
*/
-struct rspamd_fuzzy_backend* rspamd_fuzzy_backend_open (const gchar *path,
+struct rspamd_fuzzy_backend *rspamd_fuzzy_backend_open (const gchar *path,
+ gboolean vacuum,
GError **err);
/**