From 422ebd07033a04d6cd2015e8a0c808b4c7b05d8c Mon Sep 17 00:00:00 2001 From: Fabian Stamm Date: Thu, 13 Apr 2023 01:59:47 +0200 Subject: [PATCH] Save messages after check --- package.json | 2 +- src/index.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c143b1c..d7dee28 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rss-telegram-bot", - "version": "1.0.7", + "version": "1.0.8", "main": "lib/index.js", "author": "Fabian Stamm ", "license": "MIT", diff --git a/src/index.ts b/src/index.ts index e07429c..3108721 100644 --- a/src/index.ts +++ b/src/index.ts @@ -218,7 +218,9 @@ Promise.resolve().then(async () => { } function checkAll() { - Database.getAll().map(feed => checkFeed(feed).catch(err => Logging.error(err))); + Database.getAll().map(feed => checkFeed(feed).catch(err => Logging.error(err)).finally(() => { + db.write(); + })); } setInterval(() => {