Merge remote-tracking branch 'origin/main'

This commit is contained in:
2024-09-14 22:10:56 +03:30
4 changed files with 15 additions and 12 deletions

View File

@@ -7,13 +7,13 @@ namespace mstdnCats.Services
{
public class RunCheck
{
public static async Task<bool> runAsync(IDocumentCollection<Post> _db, TelegramBotClient _bot, string _tag, ILogger<MastodonBot>? logger, string _instance = "https://haminoa.net")
public static async Task<bool> runAsync(IDocumentCollection<Post> _db, TelegramBotClient _bot, string _tag, ILogger<MastodonBot>? logger, string _instance)
{
// Run check
try
{
//try
//{
// First get posts
var posts = await PostResolver.GetPostsAsync(_tag, logger, _instance);
var posts = await PostResolver.GetPostsAsync(_tag, logger, _instance??"https://haminoa.net");
if (posts == null)
{
@@ -22,11 +22,12 @@ namespace mstdnCats.Services
// Then process them
await ProcessPosts.checkAndInsertPostsAsync(_db, _bot, posts, logger);
}
catch (Exception ex)
{
logger?.LogCritical("Error while running check: " + ex.Message);
}
//}
//catch (Exception ex)
//{
// logger?.LogCritical("Error while running check: " + ex.Message);
// throw new Exception("Error while running check: " + ex.Message);
//}
return true;
}
}