Commit 6e42c641 authored by Carlos Garnacho's avatar Carlos Garnacho
Browse files

libtracker-miner: Add envvar toggle to force directory updated checks

The bugs covered by the last patches might leave leftovers in the DB if
tracker-miner-fs updated a directory after it changed between runs, but
wouldn't delete contents that were removed from the filesystem.

Add this toggle envvar to point people to a solution, if you've seen errors
like "UNIQUE constraint failed: nie:DataObject.nie:url" in journald, you're
affected by these bugs, and should run tracker-miner-fs once with
TRACKER_MINER_FORCE_CHECK_UPDATED set in the environment. Running just
once will be enough, enabling this always will incur in startup performance
penalties.
parent 1d95241e
......@@ -32,6 +32,7 @@
static GQuark quark_property_iri = 0;
static GQuark quark_property_store_mtime = 0;
static GQuark quark_property_filesystem_mtime = 0;
static gboolean force_check_updated = FALSE;
#define MAX_DEPTH 1
......@@ -375,6 +376,9 @@ file_notifier_is_directory_modified (TrackerFileNotifier *notifier,
TrackerFileNotifierPrivate *priv;
guint64 *store_mtime, *disk_mtime;
if (G_UNLIKELY (force_check_updated))
return TRUE;
priv = notifier->priv;
store_mtime = tracker_file_system_get_property (priv->file_system, file,
quark_property_store_mtime);
......@@ -1631,6 +1635,8 @@ tracker_file_notifier_class_init (TrackerFileNotifierClass *klass)
quark_property_filesystem_mtime = g_quark_from_static_string ("tracker-property-filesystem-mtime");
tracker_file_system_register_property (quark_property_filesystem_mtime,
g_free);
force_check_updated = g_getenv ("TRACKER_MINER_FORCE_CHECK_UPDATED") != NULL;
}
static void
......
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