speed tweaks

This commit is contained in:
Vincent Cloutier 2023-03-18 16:16:03 -04:00
parent 71dfe4b019
commit dd7786ce38
3 changed files with 3 additions and 4 deletions

View File

@ -14,7 +14,7 @@
public int FailingTwitterUserCleanUpThreshold { get; set; }
public int FailingFollowerCleanUpThreshold { get; set; } = -1;
public int UserCacheCapacity { get; set; }
public int UserCacheCapacity { get; set; } = 20_000;
public int TweetCacheCapacity { get; set; } = 20_000;
public int ParallelTwitterRequests { get; set; } = 10;
public int ParallelFediversePosts { get; set; } = 10;

View File

@ -106,7 +106,6 @@ namespace BirdsiteLive.Domain
var response = await client.SendAsync(httpRequestMessage);
response.EnsureSuccessStatusCode();
_logger.LogInformation("Sent tweet to " + targetHost);
_logger.LogInformation("Tweet content is " + json);
return response.StatusCode;
}

View File

@ -19,7 +19,7 @@ namespace BirdsiteLive.Twitter
private readonly MemoryCache _userCache;
private readonly MemoryCacheEntryOptions _cacheEntryOptions = new MemoryCacheEntryOptions()
.SetSize(10000)//Size amount
.SetSize(1)//Size amount
//Priority on removing when reaching size limit (memory pressure)
.SetPriority(CacheItemPriority.Low)
// Keep in cache for this time, reset time if accessed.
@ -34,7 +34,7 @@ namespace BirdsiteLive.Twitter
_userCache = new MemoryCache(new MemoryCacheOptions()
{
SizeLimit = 3000 //TODO make this use number of entries in db
SizeLimit = settings.UserCacheCapacity
});
}
#endregion