Commit d5abe8ae authored by Carlos Garnacho's avatar Carlos Garnacho
Browse files

tracker-extract: Insert SPARQL to ignore files that cause SPARQL errors

Bubble the error up from TrackerDecorator, and handle it like the other
failures in tracker-extract, so the file is reported, but doesn't sit
there waiting to be picked up for extraction again.

Now that we have "tracker3 status" and "tracker3 status $pattern", we
can patiently wait for user bug reports without melting the poles.
parent 588c4dc3
......@@ -101,6 +101,7 @@ enum {
enum {
ITEMS_AVAILABLE,
FINISHED,
ERROR,
LAST_SIGNAL
};
......@@ -261,11 +262,9 @@ retry_synchronously (TrackerDecorator *decorator,
&error);
if (error) {
GFile *file = g_file_new_for_uri (update->url);
tracker_error_report (file, error->message, update->sparql);
g_signal_emit (decorator, signals[ERROR], 0,
update->url, error->message, update->sparql);
g_error_free (error);
g_object_unref (file);
}
}
}
......@@ -1069,6 +1068,17 @@ tracker_decorator_class_init (TrackerDecoratorClass *klass)
G_STRUCT_OFFSET (TrackerDecoratorClass, finished),
NULL, NULL, NULL,
G_TYPE_NONE, 0);
signals[ERROR] =
g_signal_new ("error",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (TrackerDecoratorClass, error),
NULL, NULL, NULL,
G_TYPE_NONE, 3,
G_TYPE_STRING,
G_TYPE_STRING,
G_TYPE_STRING);
}
static void
......
......@@ -67,7 +67,10 @@ struct _TrackerDecoratorClass {
void (* items_available) (TrackerDecorator *decorator);
void (* finished) (TrackerDecorator *decorator);
void (* error) (TrackerDecorator *decorator,
const gchar *url,
const gchar *error_message,
const gchar *sparql);
/* <Private> */
gpointer padding[10];
};
......
......@@ -390,6 +390,19 @@ tracker_extract_decorator_finished (TrackerDecorator *decorator)
g_free (time_str);
}
static void
tracker_extract_decorator_error (TrackerDecorator *decorator,
const gchar *url,
const gchar *error_message,
const gchar *sparql)
{
GFile *file;
file = g_file_new_for_uri (url);
decorator_ignore_file (file, TRACKER_EXTRACT_DECORATOR (decorator), error_message, sparql);
g_object_unref (file);
}
static void
tracker_extract_decorator_class_init (TrackerExtractDecoratorClass *klass)
{
......@@ -406,6 +419,7 @@ tracker_extract_decorator_class_init (TrackerExtractDecoratorClass *klass)
decorator_class->items_available = tracker_extract_decorator_items_available;
decorator_class->finished = tracker_extract_decorator_finished;
decorator_class->error = tracker_extract_decorator_error;
g_object_class_install_property (object_class,
PROP_EXTRACTOR,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment