This repository has been archived on 2023-06-30. You can view files and clone it, but cannot push or open issues or pull requests.
2chBackAPI/BufferFill.cs
RakVhalate 50a3c94af8
All checks were successful
continuous-integration/drone/push Build is passing
added buffer and some error handling
2022-11-25 12:37:26 +10:00

21 lines
722 B
C#

namespace NeDvachAPI
{
public class BufferFill
{
public static bool FillBuffer(string board) //method to get buffer of information, which is being ran while API is started
{
List<Post> posts = DBchat.ThreadsList(board);
APIThreadBuffer.WriteThreadPreviewsBuffer(posts);
Console.WriteLine("Заполняю буфер оп-постами");
for (int threadId = 1; threadId <= 4; threadId++)
{
APIThreadBuffer.WriteThreadsBuffer(DBchat.PostsList(board , threadId));
Console.WriteLine("Добавляю буферизую тред " + threadId);
}
return true;
}
}
}