24 lines
820 B
C#
24 lines
820 B
C#
using NeDvachAPI.DBControllers;
|
||
using NeDvachAPI.Models;
|
||
|
||
namespace NeDvachAPI.BufferControllers
|
||
{
|
||
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 <= posts.Count; threadId++)
|
||
{
|
||
APIThreadBuffer.WriteThreadsBuffer(DBchat.PostsList(board, threadId));
|
||
}
|
||
Console.WriteLine($@"Буферизую треды с {1} по {posts.Count}.");
|
||
return true;
|
||
}
|
||
}
|
||
}
|