[gnome-online-accounts/gnome-3-18] daemon: Log a debug message after completing EnsureCredentials



commit 25eaf9477b4ca38cd7f97085240be32c1744940d
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Nov 27 11:11:51 2015 +0100

    daemon: Log a debug message after completing EnsureCredentials
    
    This would be useful for matching incoming calls and attempts to
    coalesce them.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=751524

 src/daemon/goadaemon.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/src/daemon/goadaemon.c b/src/daemon/goadaemon.c
index f1fd96d..e35c85e 100644
--- a/src/daemon/goadaemon.c
+++ b/src/daemon/goadaemon.c
@@ -1174,6 +1174,8 @@ static void
 ensure_credentials_queue_complete (GList *invocations, GoaAccount *account, gint expires_in, GError *error)
 {
   GList *l;
+  const gchar *id;
+  const gchar *provider_type;
 
   for (l = invocations; l != NULL; l = l->next)
     {
@@ -1187,6 +1189,10 @@ ensure_credentials_queue_complete (GList *invocations, GoaAccount *account, gint
       else
         g_dbus_method_invocation_return_gerror (invocation, error);
     }
+
+  id = goa_account_get_id (account);
+  provider_type = goa_account_get_provider_type (account);
+  g_debug ("Handled EnsureCredentials for account (%s, %s)", provider_type, id);
 }
 
 static void
@@ -1195,6 +1201,7 @@ ensure_credentials_queue_collector (GObject *source_object, GAsyncResult *res, g
   GTask *task = G_TASK (user_data);
   GoaDaemon *self;
   EnsureData *data;
+  GoaAccount *account;
   GoaProvider *provider = GOA_PROVIDER (source_object);
   GError *error;
   gint expires_in;
@@ -1203,6 +1210,7 @@ ensure_credentials_queue_collector (GObject *source_object, GAsyncResult *res, g
   g_assert (task == G_TASK (g_queue_pop_head (self->ensure_credentials_queue)));
 
   data = g_task_get_task_data (task);
+  account = goa_object_peek_account (data->object);
 
   error= NULL;
   if (!goa_provider_ensure_credentials_finish (provider, &expires_in, res, &error))
@@ -1210,8 +1218,6 @@ ensure_credentials_queue_collector (GObject *source_object, GAsyncResult *res, g
       /* Set AttentionNeeded only if the error is an authorization error */
       if (is_authorization_error (error))
         {
-          GoaAccount *account;
-          account = goa_object_peek_account (data->object);
           if (!goa_account_get_attention_needed (account))
             {
               goa_account_set_attention_needed (account, TRUE);
@@ -1222,14 +1228,11 @@ ensure_credentials_queue_collector (GObject *source_object, GAsyncResult *res, g
             }
         }
 
-      ensure_credentials_queue_complete (data->invocations, NULL, 0, error);
+      ensure_credentials_queue_complete (data->invocations, account, 0, error);
       g_error_free (error);
     }
   else
     {
-      GoaAccount *account;
-      account = goa_object_peek_account (data->object);
-
       /* Clear AttentionNeeded flag if set */
       if (goa_account_get_attention_needed (account))
         {


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