Added MongoDb connection string to config options
This commit is contained in:
@@ -14,7 +14,7 @@ namespace mstdnCats.Services
|
||||
{
|
||||
public static async Task HandleCallbackQuery(CallbackQuery callbackQuery, IDocumentCollection<Post> _db, TelegramBotClient _bot, ILogger<MastodonBot>? logger)
|
||||
{
|
||||
var config = configData.fetchData();
|
||||
var config = ConfigData.fetchData();
|
||||
|
||||
// Extract media ID from callback query data
|
||||
string[] parts = callbackQuery.Data.Split('-');
|
||||
|
@@ -12,7 +12,7 @@ namespace mstdnCats.Services
|
||||
{
|
||||
public static async Task<List<MediaAttachment>> checkAndInsertPostsAsync(IDocumentCollection<Post> _db, TelegramBotClient _bot, List<Post> fetchedPosts, ILogger<MastodonBot>? logger)
|
||||
{
|
||||
var config = configData.fetchData();
|
||||
var config = ConfigData.fetchData();
|
||||
|
||||
// Get existing posts
|
||||
var existingPosts = _db.AsQueryable().Select(x => x.mstdnPostId).ToArray();
|
||||
|
@@ -10,8 +10,8 @@ namespace mstdnCats.Services
|
||||
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);
|
||||
|
||||
@@ -22,12 +22,11 @@ namespace mstdnCats.Services
|
||||
|
||||
// Then process them
|
||||
await ProcessPosts.checkAndInsertPostsAsync(_db, _bot, posts, logger);
|
||||
//}
|
||||
//catch (Exception ex)
|
||||
//{
|
||||
// logger?.LogCritical("Error while running check: " + ex.Message);
|
||||
// throw new Exception("Error while running check: " + ex.Message);
|
||||
//}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger?.LogCritical("Error while running check: " + ex.Message);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user