wellknown optimisation
This commit is contained in:
parent
5ac5555bf6
commit
a6680df03e
1 changed files with 23 additions and 19 deletions
|
@ -201,26 +201,30 @@ namespace BirdsiteLive.Controllers
|
||||||
if (!string.IsNullOrWhiteSpace(domain) && domain != _settings.Domain)
|
if (!string.IsNullOrWhiteSpace(domain) && domain != _settings.Domain)
|
||||||
return NotFound();
|
return NotFound();
|
||||||
|
|
||||||
try
|
var user = await _twitterUserDal.GetTwitterUserAsync(name);
|
||||||
|
if (user is null)
|
||||||
{
|
{
|
||||||
await _twitterUserService.GetUserAsync(name);
|
try
|
||||||
}
|
{
|
||||||
catch (UserNotFoundException)
|
await _twitterUserService.GetUserAsync(name);
|
||||||
{
|
}
|
||||||
return NotFound();
|
catch (UserNotFoundException)
|
||||||
}
|
{
|
||||||
catch (UserHasBeenSuspendedException)
|
return NotFound();
|
||||||
{
|
}
|
||||||
return NotFound();
|
catch (UserHasBeenSuspendedException)
|
||||||
}
|
{
|
||||||
catch (RateLimitExceededException)
|
return NotFound();
|
||||||
{
|
}
|
||||||
return new ObjectResult("Too Many Requests") { StatusCode = 429 };
|
catch (RateLimitExceededException)
|
||||||
}
|
{
|
||||||
catch (Exception e)
|
return new ObjectResult("Too Many Requests") { StatusCode = 429 };
|
||||||
{
|
}
|
||||||
_logger.LogError(e, "Exception getting {Name}", name);
|
catch (Exception e)
|
||||||
throw;
|
{
|
||||||
|
_logger.LogError(e, "Exception getting {Name}", name);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var actorUrl = UrlFactory.GetActorUrl(_settings.Domain, name);
|
var actorUrl = UrlFactory.GetActorUrl(_settings.Domain, name);
|
||||||
|
|
Loading…
Add table
Reference in a new issue