made some improvements to the base http handler
This commit is contained in:
parent
19e202d5e1
commit
d8c01ded6e
@@ -16,7 +16,7 @@ namespace MediaBrowser.Api.HttpHandlers
|
||||
{
|
||||
return ApiService.IsApiUrlMatch("weather", request);
|
||||
}
|
||||
|
||||
|
||||
protected override Task<WeatherInfo> GetObjectToSerialize()
|
||||
{
|
||||
// If a specific zip code was requested on the query string, use that. Otherwise use the value from configuration
|
||||
@@ -31,15 +31,13 @@ namespace MediaBrowser.Api.HttpHandlers
|
||||
return Kernel.Instance.WeatherProviders.First().GetWeatherInfoAsync(zipCode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tell the client to cache the weather info for 15 minutes
|
||||
/// </summary>
|
||||
public override TimeSpan CacheDuration
|
||||
protected override async Task<ResponseInfo> GetResponseInfo()
|
||||
{
|
||||
get
|
||||
{
|
||||
return TimeSpan.FromMinutes(15);
|
||||
}
|
||||
var info = await base.GetResponseInfo().ConfigureAwait(false);
|
||||
|
||||
info.CacheDuration = TimeSpan.FromMinutes(15);
|
||||
|
||||
return info;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user