Updates to the archiving system to **NOT** crash the container every

single time it tries to archive stuff & remove goals before next devlog
markdown file.
This commit is contained in:
yuanhau 2025-06-16 22:10:57 +08:00
parent 5445a3d1c0
commit fce450bc7e
5 changed files with 17 additions and 24 deletions

View file

@ -43,12 +43,12 @@ async function storeArticlesIfItDoesNotExists(data, RequestId) {
SELECT * FROM news_articles
WHERE jsondata = ${data}
`;
if (checkDataIsInDatabase.length === 0) {
if (checkDataIsInDatabase.length > 0) {
return;
}
const storeData = await sql`
INSERT INTO news_articles (uuid, article_id, jsondata)
VALUES (${uuidv4()}, ${RequestId}, ${data})
VALUES (${uuidv4()}, ${RequestId}, ${data}::JSON)
`;
console.log(storeData);
return;