]> source.dussan.org Git - rspamd.git/commitdiff
Skip missing statfiles on classifying.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 9 Jul 2015 08:38:03 +0000 (09:38 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 9 Jul 2015 08:38:03 +0000 (09:38 +0100)
src/libstat/stat_process.c

index 588beb9727e73fb09aa93720fcaae1d245d29736..978264ac49cf7765612a5a194d9266dd0701c9f0 100644 (file)
@@ -219,13 +219,22 @@ rspamd_stat_preprocess (struct rspamd_stat_ctx *st_ctx,
                        backend_runtime = bk->runtime (task, stcf, op != RSPAMD_CLASSIFY_OP,
                                        bk->ctx);
 
-                       if (backend_runtime == NULL && op != RSPAMD_CLASSIFY_OP) {
-                               /* Assume backend absence as fatal error */
-                               g_set_error (err, rspamd_stat_quark(), 500,
-                                       "cannot open backend for statfile %s", stcf->symbol);
-                               g_list_free (cl_runtimes);
-
-                               return NULL;
+                       if (backend_runtime == NULL) {
+                               if (op != RSPAMD_CLASSIFY_OP) {
+                                       /* Assume backend absence as fatal error */
+                                       g_set_error (err, rspamd_stat_quark(), 500,
+                                                       "cannot open backend for statfile %s", stcf->symbol);
+                                       g_list_free (cl_runtimes);
+
+                                       return NULL;
+                               }
+                               else {
+                                       /* Just skip this element */
+                                       msg_warn ("backend of type %s does not exist: %s",
+                                                       stcf->backend, stcf->symbol);
+                                       curst = g_list_next (curst);
+                                       continue;
+                               }
                        }
 
                        st_runtime = rspamd_mempool_alloc0 (task->task_pool,