[rhythmbox] use a longer timeout for metadata save operations (bug #577433)



commit 4b5f8b7ece6ba0a5e9f4dd7df2b46f210b85caea
Author: Jonathan Matthew <jonathan d14n org>
Date:   Fri May 8 18:51:03 2009 +1000

    use a longer timeout for metadata save operations  (bug #577433)
---
 metadata/rb-metadata-dbus-client.c |    2 +-
 metadata/rb-metadata-dbus.h        |    7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/metadata/rb-metadata-dbus-client.c b/metadata/rb-metadata-dbus-client.c
index 12bcde7..0d2f9c5 100644
--- a/metadata/rb-metadata-dbus-client.c
+++ b/metadata/rb-metadata-dbus-client.c
@@ -724,7 +724,7 @@ rb_metadata_save (RBMetaData *md, GError **error)
 	if (*error == NULL) {
 		response = dbus_connection_send_with_reply_and_block (dbus_connection,
 								      message,
-								      RB_METADATA_DBUS_TIMEOUT,
+								      RB_METADATA_SAVE_DBUS_TIMEOUT,
 								      &dbus_error);
 		if (!response) {
 			handle_dbus_error (md, &dbus_error, error);
diff --git a/metadata/rb-metadata-dbus.h b/metadata/rb-metadata-dbus.h
index 022e828..e365426 100644
--- a/metadata/rb-metadata-dbus.h
+++ b/metadata/rb-metadata-dbus.h
@@ -40,10 +40,13 @@ G_BEGIN_DECLS
 #define RB_METADATA_DBUS_OBJECT_PATH	"/org/gnome/rhythmbox/MetadataService"
 #define RB_METADATA_DBUS_INTERFACE	"org.gnome.rhythmbox.Metadata"
 
-/* Timeout in milliseconds.  If a metadata operation takes longer than this,
- * the metadata process will be killed and the operation will fail.
+/* Timeouts in milliseconds.  If a metadata operation takes longer than this,
+ * the metadata process will be killed and the operation will fail.  We use a
+ * longer timeout for save operations because they involve reading and writing
+ * the entire file being modified, which can take some time on slow devices.
  */
 #define RB_METADATA_DBUS_TIMEOUT	(15000)
+#define RB_METADATA_SAVE_DBUS_TIMEOUT	(120000)
 
 gboolean	rb_metadata_dbus_get_boolean (DBusMessageIter *iter,
 					      gboolean *value);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]