[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [Tracker] About "Linux Kernel file notification" support
- From: "Marcus Fritzsch" <fritschy googlemail com>
- To: jamie <jamiemcc blueyonder co uk>
- Cc: Tracker-List <tracker-list gnome org>
- Subject: Re: [Tracker] About "Linux Kernel file notification" support
- Date: Sun, 15 Jul 2007 20:35:08 +0200
Hey,
On 7/15/07, jamie <jamiemcc blueyonder co uk> wrote:
[...]
we plan on increasing it to 30 secs default with an override in the cfg
file and tracker-preferences so it can be fine tuned
remember trackerd is running at nice +19 and on linux with low priority
disk reads so it should not have a enormous effect at start up anyhow
Is it coincidence that I did a patch to introduce an InitialSleep cfg
option, and the required internals. One thing missing though is
tracker-preferences support for it, I never touched gtk+...
Feel free to use it if it fits your needs.
Kind regards, Marcus
diff --git a/src/tracker-preferences/tracker-configuration.c b/src/tracker-preferences/tracker-configuration.c
index 242b9db..dc8fe35 100644
--- a/src/tracker-preferences/tracker-configuration.c
+++ b/src/tracker-preferences/tracker-configuration.c
@@ -217,7 +217,7 @@ g_key_file_set_double_list (GKeyFile *key_file,
* End of copied functions.
*
**********************************************************************/
-#endif /* HAVE_RECENT_GLIB */
+#endif /* !HAVE_RECENT_GLIB */
static GObjectClass *parent_class = NULL;
diff --git a/src/trackerd/tracker-utils.c b/src/trackerd/tracker-utils.c
index 2f87ad0..b5f56d5 100644
--- a/src/trackerd/tracker-utils.c
+++ b/src/trackerd/tracker-utils.c
@@ -2276,6 +2276,8 @@ tracker_load_config_file ()
"NoWatchDirectory=\n",
"# Set to false to prevent watching of any kind\n",
"EnableWatching=true\n\n",
+ "# Set the initial sleeping time, in seconds\n",
+ "InitialSleep=5\n",
"[Indexing]\n",
"# Throttles the indexing process. Allowable values are 0-20. higher values decrease indexing speed\n",
"Throttle=0\n",
@@ -2294,7 +2296,7 @@ tracker_load_config_file ()
"# Sets the language specific stemmer and stopword list to use \n",
"# Valid values are 'en' (english), 'da' (danish), 'nl' (dutch), 'fi' (finnish), 'fr' (french), 'de' (german), 'it' (italien), 'nb' (norwegian), 'pt' (portugese), 'ru' (russian), 'es' (spanish), 'sv' (swedish)\n",
"Language=", language, "\n",
- "# Enables use of language-specific stemmer\n",
+ "# Enables use of language-specific stemmer\n",
"EnableStemmer=true\n",
"[Emails]\n",
"IndexEvolutionEmails=true\n",
@@ -2330,7 +2332,11 @@ tracker_load_config_file ()
if (g_key_file_has_key (key_file, "General", "LowMemoryMode", NULL)) {
tracker->use_extra_memory = !g_key_file_get_boolean (key_file, "General", "LowMemoryMode", NULL);
- }
+ }
+
+ if (g_key_file_has_key (key_file, "General", "InitialSleep", NULL)) {
+ tracker->initial_sleep = g_key_file_get_integer (key_file, "General", "InitialSleep", NULL);
+ }
/* Watch options */
@@ -3430,7 +3436,7 @@ output_log (const char *message)
strftime (buffer1, 64, "%d %b %Y, %H:%M:%S:", loctime);
- g_sprintf (buffer2, "%ld", start.tv_usec / 1000);
+ g_sprintf (buffer2, "%03ld", start.tv_usec / 1000);
output = g_strconcat (buffer1, buffer2, " - ", message, NULL);
diff --git a/src/trackerd/tracker-utils.h b/src/trackerd/tracker-utils.h
index c6e489a..83e4142 100644
--- a/src/trackerd/tracker-utils.h
+++ b/src/trackerd/tracker-utils.h
@@ -214,6 +214,7 @@ typedef struct {
int default_throttle;
int battery_throttle;
gboolean use_extra_memory;
+ int initial_sleep;
/* indexing options */
int max_index_bucket_count;
diff --git a/src/trackerd/trackerd.c b/src/trackerd/trackerd.c
index 7108f0f..f1748ad 100644
--- a/src/trackerd/trackerd.c
+++ b/src/trackerd/trackerd.c
@@ -947,9 +947,11 @@ process_files_thread (void)
case INDEX_CONVERSATIONS: {
char *gaim;
- /* sleep for 5 secs before watching/indexing any of the major services */
- tracker_log ("sleeping for 5 secs...");
- g_usleep (5 * 1000 * 1000);
+ /* sleep for N secs before watching/indexing any of the major services */
+ if (tracker->initial_sleep > 0) {
+ tracker_log ("sleeping for %d secs...", tracker->initial_sleep);
+ g_usleep (tracker->initial_sleep * 1000 * 1000);
+ }
gaim = g_build_filename (g_get_home_dir(), ".gaim", "logs", NULL);
@@ -1806,6 +1808,7 @@ set_defaults ()
tracker->use_extra_memory = TRUE;
tracker->throttle = 0;
+ tracker->initial_sleep = 5;
tracker->min_word_length = 3;
tracker->max_word_length = 30;
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]