Explorar el Código

Skip news updating on news aggregator with config

ghorsington hace 5 años
padre
commit
b69c4a32bc
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  1. 6 0
      bot/src/commands/news_aggregator.ts

+ 6 - 0
bot/src/commands/news_aggregator.ts

@@ -95,6 +95,12 @@ async function addNewsItem(item: NewsPostItem) {
     });
     });
 
 
     if(newsItem) {
     if(newsItem) {
+        if(process.env.INGORE_CHANGED_NEWS === "TRUE") {
+            newsItem.hash = item.hash;
+            await repo.save(newsItem);
+            return;
+        }
+
         // No changes, skip
         // No changes, skip
         if(newsItem.hash == item.hash)
         if(newsItem.hash == item.hash)
             return;
             return;