public ImgurApi()
{
this.http = Networking.CreateHttpClient(Networking.CreateHttpClientHandler());
- this.http.Timeout = TimeSpan.FromMinutes(1);
+ this.http.Timeout = Networking.UploadImageTimeout;
}
public async Task<XDocument> UploadFileAsync(IMediaItem item, string title)
var handler = twitterApi.CreateOAuthEchoHandler(AuthServiceProvider, OAuthRealm);
this.http = Networking.CreateHttpClient(handler);
- this.http.Timeout = TimeSpan.FromMinutes(1);
+ this.http.Timeout = Networking.UploadImageTimeout;
}
/// <summary>
public static class Networking
{
public static TimeSpan DefaultTimeout { get; set; }
+ public static TimeSpan UploadImageTimeout { get; set; }
/// <summary>
/// 通信に使用するプロキシの種類
static Networking()
{
DefaultTimeout = TimeSpan.FromSeconds(20);
+ UploadImageTimeout = TimeSpan.FromSeconds(60);
globalHttpClient = CreateHttpClient(new HttpClientHandler());
}
var handler = twitterApi.CreateOAuthEchoHandler(AuthServiceProvider, OAuthRealm);
this.http = Networking.CreateHttpClient(handler);
- this.http.Timeout = TimeSpan.FromMinutes(1);
+ this.http.Timeout = Networking.UploadImageTimeout;
}
/// <summary>
this.http = InitializeHttpClient(this.AccessToken, this.AccessSecret);
this.httpUpload = InitializeHttpClient(this.AccessToken, this.AccessSecret);
- this.httpUpload.Timeout = TimeSpan.FromMinutes(1);
+ this.httpUpload.Timeout = Networking.UploadImageTimeout;
this.httpStreaming = InitializeHttpClient(this.AccessToken, this.AccessSecret, disableGzip: true);
this.httpStreaming.Timeout = Timeout.InfiniteTimeSpan;
var handler = twitterApi.CreateOAuthEchoHandler(AuthServiceProvider, OAuthRealm);
this.http = Networking.CreateHttpClient(handler);
- this.http.Timeout = TimeSpan.FromMinutes(1);
+ this.http.Timeout = Networking.UploadImageTimeout;
}
/// <summary>
var handler = twitterApi.CreateOAuthEchoHandler(AuthServiceProvider, OAuthRealm);
this.http = Networking.CreateHttpClient(handler);
- this.http.Timeout = TimeSpan.FromMinutes(1);
+ this.http.Timeout = Networking.UploadImageTimeout;
}
/// <summary>
public bool UseUnreadStyle = true;
public string DateTimeFormat = "yyyy/MM/dd H:mm:ss";
public int DefaultTimeOut = 20;
+
+ /// <summary>画像アップロードのタイムアウト設定 (秒)</summary>
+ public int UploadImageTimeout { get; set; } = 60;
+
public bool RetweetNoConfirm = false;
public bool LimitBalloon = false;
public bool TabIconDisp = true;
//Twitter用通信クラス初期化
Networking.DefaultTimeout = TimeSpan.FromSeconds(this._cfgCommon.DefaultTimeOut);
+ Networking.UploadImageTimeout = TimeSpan.FromSeconds(this._cfgCommon.UploadImageTimeout);
Networking.SetWebProxy(this._cfgLocal.ProxyType,
this._cfgLocal.ProxyAddress, this._cfgLocal.ProxyPort,
this._cfgLocal.ProxyUser, this._cfgLocal.ProxyPassword);