Stage 1 of migrating to MongoDb - fully added mongodb

This commit is contained in:
2024-12-15 17:01:48 +03:30
parent e0cdcf1198
commit fbe0d500d9
5 changed files with 13 additions and 13 deletions

View File

@@ -13,8 +13,8 @@ public class HandleDbBackup
{
logger?.LogInformation("Backup requested");
await using Stream stream = System.IO.File.OpenRead("./" + dbname+".json");
var message = await _bot.SendDocument(adminId, document: InputFile.FromStream(stream, dbname+".json"),
await using Stream stream = System.IO.File.OpenRead("./data/" + dbname+"_BK.json");
var message = await _bot.SendDocument(adminId, document: InputFile.FromStream(stream, dbname+"_BK.json"),
caption: "Backup of " + dbname + "\nCreated at " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss" + "\nCurrent post count: " + _db.AsQueryable().Count()), parseMode: ParseMode.Html);
logger?.LogInformation("Backup sent");