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

Proposed by dobey on 2012-04-02
Status: Merged
Approved by: dobey on 2012-04-02
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 on 2012-04-02
Eric Casteleijn (community) 2012-04-02 Approve on 2012-04-02
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 on 2012-04-02
150. By dobey on 2012-04-02

Revert extraneous change

Eric Casteleijn (thisfred) :
review: Approve
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libubuntuoneui/u1-music-store.c'
2--- libubuntuoneui/u1-music-store.c 2012-03-06 21:10:59 +0000
3+++ libubuntuoneui/u1-music-store.c 2012-04-02 17:30:25 +0000
4@@ -1151,67 +1151,6 @@
5 syncdaemon_folder_info_get_volume_id (folder_info));
6 }
7
8-static void
9-_u1_purchased_enumerate (GObject *source, GAsyncResult *result,
10- gpointer user_data)
11-{
12- U1MusicStore *music_store = U1_MUSIC_STORE (user_data);
13- GFile *dir = G_FILE (source);
14- GFileEnumerator *files;
15- GFileInfo *info;
16- GError *error = NULL;
17-
18- files = g_file_enumerate_children_finish (dir, result, &error);
19-
20- if (error != NULL) {
21- g_warning ("Error rescanning Purchased Music: %s", error->message);
22- g_error_free (error);
23- return;
24- }
25-
26- while ((info = g_file_enumerator_next_file (files, NULL, NULL)) != NULL) {
27- gchar *path;
28-
29- path = g_build_filename (g_file_get_path (dir),
30- g_file_info_get_name (info),
31- NULL);
32- if (g_file_test (path, G_FILE_TEST_IS_DIR)) {
33- GFile *subdir = g_file_new_for_path (path);
34- g_file_enumerate_children_async (subdir,
35- G_FILE_ATTRIBUTE_STANDARD_NAME,
36- G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
37- G_PRIORITY_DEFAULT, NULL,
38- (GAsyncReadyCallback) _u1_purchased_enumerate,
39- music_store);
40- } else if (g_file_test (path, G_FILE_TEST_IS_REGULAR)) {
41- g_signal_emit (music_store,
42- u1_music_store_signals[DOWNLOAD_FINISHED_SIGNAL], 0,
43- (const gchar *) path);
44- }
45-
46- g_free (path);
47- g_object_unref (info);
48- }
49- g_file_enumerator_close (files, NULL, NULL);
50- g_object_unref (dir);
51-}
52-
53-static void
54-_u1_music_store_rescan_purchased_folder (U1MusicStore *music_store)
55-{
56- GFile *dir;
57- const gchar *path;
58-
59- path = u1_music_store_get_library_location (music_store);
60- dir = g_file_new_for_path (path);
61- g_file_enumerate_children_async (dir,
62- G_FILE_ATTRIBUTE_STANDARD_NAME,
63- G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
64- G_PRIORITY_DEFAULT, NULL,
65- (GAsyncReadyCallback) _u1_purchased_enumerate,
66- music_store);
67-}
68-
69 static gboolean
70 _u1_music_store_delayed_init (gpointer user_data)
71 {
72@@ -1222,9 +1161,6 @@
73 folder_info = syncdaemon_daemon_get_folder_info (music_store->priv->syncdaemon, u1_music_store_get_library_location (music_store));
74 music_store->priv->folder_subscribed = syncdaemon_folder_info_get_subscribed (folder_info);
75
76- /* Rescan the purchased music folder */
77- _u1_music_store_rescan_purchased_folder (music_store);
78-
79 return FALSE;
80 }
81

Subscribers

People subscribed via source and target branches