Merge lp:~dobey/libubuntuone/boy-racer into lp:libubuntuone

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 150
Merged at revision: 149
Proposed branch: lp:~dobey/libubuntuone/boy-racer
Merge into: lp:libubuntuone
Diff against target: 80 lines (+0/-64)
1 file modified
libubuntuoneui/u1-music-store.c (+0/-64)
To merge this branch: bzr merge lp:~dobey/libubuntuone/boy-racer
Reviewer Review Type Date Requested Status
Manuel de la Peña (community) Approve
Eric Casteleijn (community) Approve
Review via email: mp+100476@code.launchpad.net

Commit message

Remove the rescanning of purchased folder on startup to prevent a race condition

Description of the change

This removes the rescanning of the purchased music folder on start-up, as the increased disk i/o it causes, seems to result in a race condition where the URL is not getting properly signed, causing an auth failure, which results in the token getting removed from the keyring, and the odd error of the token not existing, which actually did exist a few seconds ago when it was queried last, when rhythmbox is being started with a u1ms:// URL passed to it, when not already running.

To post a comment you must log in.
lp:~dobey/libubuntuone/boy-racer updated
150. By dobey

Revert extraneous change

Revision history for this message
Eric Casteleijn (thisfred) :
review: Approve
Revision history for this message
Manuel de la Peña (mandel) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'libubuntuoneui/u1-music-store.c'
--- libubuntuoneui/u1-music-store.c 2012-03-06 21:10:59 +0000
+++ libubuntuoneui/u1-music-store.c 2012-04-02 17:30:25 +0000
@@ -1151,67 +1151,6 @@
1151 syncdaemon_folder_info_get_volume_id (folder_info));1151 syncdaemon_folder_info_get_volume_id (folder_info));
1152}1152}
11531153
1154static void
1155_u1_purchased_enumerate (GObject *source, GAsyncResult *result,
1156 gpointer user_data)
1157{
1158 U1MusicStore *music_store = U1_MUSIC_STORE (user_data);
1159 GFile *dir = G_FILE (source);
1160 GFileEnumerator *files;
1161 GFileInfo *info;
1162 GError *error = NULL;
1163
1164 files = g_file_enumerate_children_finish (dir, result, &error);
1165
1166 if (error != NULL) {
1167 g_warning ("Error rescanning Purchased Music: %s", error->message);
1168 g_error_free (error);
1169 return;
1170 }
1171
1172 while ((info = g_file_enumerator_next_file (files, NULL, NULL)) != NULL) {
1173 gchar *path;
1174
1175 path = g_build_filename (g_file_get_path (dir),
1176 g_file_info_get_name (info),
1177 NULL);
1178 if (g_file_test (path, G_FILE_TEST_IS_DIR)) {
1179 GFile *subdir = g_file_new_for_path (path);
1180 g_file_enumerate_children_async (subdir,
1181 G_FILE_ATTRIBUTE_STANDARD_NAME,
1182 G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
1183 G_PRIORITY_DEFAULT, NULL,
1184 (GAsyncReadyCallback) _u1_purchased_enumerate,
1185 music_store);
1186 } else if (g_file_test (path, G_FILE_TEST_IS_REGULAR)) {
1187 g_signal_emit (music_store,
1188 u1_music_store_signals[DOWNLOAD_FINISHED_SIGNAL], 0,
1189 (const gchar *) path);
1190 }
1191
1192 g_free (path);
1193 g_object_unref (info);
1194 }
1195 g_file_enumerator_close (files, NULL, NULL);
1196 g_object_unref (dir);
1197}
1198
1199static void
1200_u1_music_store_rescan_purchased_folder (U1MusicStore *music_store)
1201{
1202 GFile *dir;
1203 const gchar *path;
1204
1205 path = u1_music_store_get_library_location (music_store);
1206 dir = g_file_new_for_path (path);
1207 g_file_enumerate_children_async (dir,
1208 G_FILE_ATTRIBUTE_STANDARD_NAME,
1209 G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
1210 G_PRIORITY_DEFAULT, NULL,
1211 (GAsyncReadyCallback) _u1_purchased_enumerate,
1212 music_store);
1213}
1214
1215static gboolean1154static gboolean
1216_u1_music_store_delayed_init (gpointer user_data)1155_u1_music_store_delayed_init (gpointer user_data)
1217{1156{
@@ -1222,9 +1161,6 @@
1222 folder_info = syncdaemon_daemon_get_folder_info (music_store->priv->syncdaemon, u1_music_store_get_library_location (music_store));1161 folder_info = syncdaemon_daemon_get_folder_info (music_store->priv->syncdaemon, u1_music_store_get_library_location (music_store));
1223 music_store->priv->folder_subscribed = syncdaemon_folder_info_get_subscribed (folder_info);1162 music_store->priv->folder_subscribed = syncdaemon_folder_info_get_subscribed (folder_info);
12241163
1225 /* Rescan the purchased music folder */
1226 _u1_music_store_rescan_purchased_folder (music_store);
1227
1228 return FALSE;1164 return FALSE;
1229}1165}
12301166

Subscribers

People subscribed via source and target branches