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/BufferControllers/BufferFill.cs
RakVhalate ecc3a4d321
All checks were successful
continuous-integration/drone/push Build is passing
123
2022-12-20 18:45:22 +05:00

24 lines
820 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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;
}
}
}