mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 13:04:23 +00:00
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:
parent
5445a3d1c0
commit
fce450bc7e
5 changed files with 17 additions and 24 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue