reducing avatars lookups for failed addresses
This commit is contained in:
parent
554b9b4c16
commit
de0f480878
|
@ -81,6 +81,7 @@ namespace SparkleShare {
|
|||
public abstract string PluginsPath { get; }
|
||||
|
||||
private SparkleFetcherBase fetcher;
|
||||
private List<string> failed_avatars = new List<string> ();
|
||||
|
||||
|
||||
// Short alias for the translations
|
||||
|
@ -933,6 +934,8 @@ namespace SparkleShare {
|
|||
old_avatars.Add (email);
|
||||
}
|
||||
|
||||
} else if (this.failed_avatars.Contains (email)) {
|
||||
break;
|
||||
} else {
|
||||
WebClient client = new WebClient ();
|
||||
string url = "http://gravatar.com/avatar/" + GetMD5 (email) +
|
||||
|
@ -954,8 +957,11 @@ namespace SparkleShare {
|
|||
SparkleHelpers.DebugInfo ("Controller", "Failed fetching gravatar for " + email);
|
||||
|
||||
// Stop downloading further avatars if we have no internet access
|
||||
if (e.Status == WebExceptionStatus.Timeout)
|
||||
if (e.Status == WebExceptionStatus.Timeout){
|
||||
break;
|
||||
} else {
|
||||
this.failed_avatars.Add (email);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue