[tracker-miners/wip/carlosg/batches-and-resources: 18/31] libtracker-miner: Drop SPARQL buffer flush timeout
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/wip/carlosg/batches-and-resources: 18/31] libtracker-miner: Drop SPARQL buffer flush timeout
- Date: Fri, 11 Dec 2020 10:55:03 +0000 (UTC)
commit 726b113ff20d6c52190a0056e9c9d4b03f6e769a
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Dec 2 11:58:03 2020 +0100
libtracker-miner: Drop SPARQL buffer flush timeout
This 15s timeout is hilariously long taking into account that
the buffer size is ~100 elements. This should just be here to cater
for misuses (e.g. forgetting to flush), so drop this.
src/libtracker-miner/tracker-sparql-buffer.c | 46 ----------------------------
1 file changed, 46 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-sparql-buffer.c b/src/libtracker-miner/tracker-sparql-buffer.c
index 28a536974..f7d89fc87 100644
--- a/src/libtracker-miner/tracker-sparql-buffer.c
+++ b/src/libtracker-miner/tracker-sparql-buffer.c
@@ -26,9 +26,6 @@
#include "tracker-sparql-buffer.h"
-/* Maximum time (seconds) before forcing a sparql buffer flush */
-#define MAX_SPARQL_BUFFER_TIME 15
-
typedef struct _TrackerSparqlBufferPrivate TrackerSparqlBufferPrivate;
typedef struct _SparqlTaskData SparqlTaskData;
typedef struct _UpdateArrayData UpdateArrayData;
@@ -41,7 +38,6 @@ enum {
struct _TrackerSparqlBufferPrivate
{
TrackerSparqlConnection *connection;
- guint flush_timeout_id;
GPtrArray *tasks;
gint n_updates;
};
@@ -69,10 +65,6 @@ tracker_sparql_buffer_finalize (GObject *object)
g_object_unref (priv->connection);
- if (priv->flush_timeout_id != 0) {
- g_source_remove (priv->flush_timeout_id);
- }
-
G_OBJECT_CLASS (tracker_sparql_buffer_parent_class)->finalize (object);
}
@@ -137,35 +129,6 @@ tracker_sparql_buffer_class_init (TrackerSparqlBufferClass *klass)
G_PARAM_STATIC_STRINGS));
}
-static gboolean
-flush_timeout_cb (gpointer user_data)
-{
- TrackerSparqlBuffer *buffer = user_data;
- TrackerSparqlBufferPrivate *priv;
-
- priv = tracker_sparql_buffer_get_instance_private (buffer);
- tracker_sparql_buffer_flush (buffer, "Buffer time reached");
- priv->flush_timeout_id = 0;
-
- return FALSE;
-}
-
-static void
-reset_flush_timeout (TrackerSparqlBuffer *buffer)
-{
- TrackerSparqlBufferPrivate *priv;
-
- priv = tracker_sparql_buffer_get_instance_private (buffer);
-
- if (priv->flush_timeout_id != 0) {
- g_source_remove (priv->flush_timeout_id);
- }
-
- priv->flush_timeout_id = g_timeout_add_seconds (MAX_SPARQL_BUFFER_TIME,
- flush_timeout_cb,
- buffer);
-}
-
static void
tracker_sparql_buffer_init (TrackerSparqlBuffer *buffer)
{
@@ -293,11 +256,6 @@ tracker_sparql_buffer_flush (TrackerSparqlBuffer *buffer,
TRACKER_NOTE (MINER_FS_EVENTS, g_message ("Flushing SPARQL buffer, reason: %s", reason));
- if (priv->flush_timeout_id != 0) {
- g_source_remove (priv->flush_timeout_id);
- priv->flush_timeout_id = 0;
- }
-
/* Loop buffer and construct array of strings */
sparql_array = g_array_new (FALSE, TRUE, sizeof (gchar *));
@@ -341,10 +299,6 @@ sparql_buffer_push_to_pool (TrackerSparqlBuffer *buffer,
priv = tracker_sparql_buffer_get_instance_private (buffer);
- if (tracker_task_pool_get_size (TRACKER_TASK_POOL (buffer)) == 0) {
- reset_flush_timeout (buffer);
- }
-
/* Task pool addition increments reference */
tracker_task_pool_add (TRACKER_TASK_POOL (buffer), task);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]