Ver Fonte

added 5 sec between each call

Pablo Barrera Yaksic há 7 meses atrás
pai
commit
f698e70945

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "bot-noticias",
-  "version": "0.0.5",
+  "version": "0.0.6",
   "description": "Bot que busca noticias y las replica en mastodon.cl",
   "main": "dist/index.js",
   "scripts": {

+ 5 - 1
src/index.ts

@@ -9,7 +9,7 @@ import { handler as theclinic } from "./portales/theclinic/handler";
 const context: Context = {
   callbackWaitsForEmptyEventLoop: false,
   functionName: "",
-  functionVersion: "$LATEST",
+  functionVersion: "",
   invokedFunctionArn: "",
   memoryLimitInMB: "0",
   awsRequestId: "",
@@ -23,9 +23,13 @@ const context: Context = {
 
 async function main (): Promise<void> {
   await elciudadano(null, context, () => {});
+  await new Promise((resolve) => setTimeout(resolve, 5000));
   await eldesconcierto(null, context, () => {});
+  await new Promise((resolve) => setTimeout(resolve, 5000));
   await emol(null, context, () => {});
+  await new Promise((resolve) => setTimeout(resolve, 5000));
   await latercera(null, context, () => {});
+  await new Promise((resolve) => setTimeout(resolve, 5000));
   await theclinic(null, context, () => {});
 }
 

+ 1 - 1
src/portales/elciudadano/handler.ts

@@ -36,7 +36,7 @@ export const handler: Handler = async (event, context) => {
     let totalPublished = 0;
     const length = articles.length;
 
-    // Order has to be reverser to appear in the correct order when posting
+    // Order has to be reversed to appear in the correct order when posting
     for (let i = length - 1; i >= 0; i--) {
       const article = articles[i];
       const exists = await redisClient.retrieve(article.link);

+ 1 - 1
src/portales/eldesconcierto/handler.ts

@@ -36,7 +36,7 @@ export const handler: Handler = async (event, context) => {
     let totalPublished = 0;
     const length = articles.length;
 
-    // Order has to be reverser to appear in the correct order when posting
+    // Order has to be reversed to appear in the correct order when posting
     for (let i = length - 1; i >= 0; i--) {
       const article = articles[i];
       const exists = await redisClient.retrieve(article.link);

+ 1 - 1
src/portales/emol/handler.ts

@@ -36,7 +36,7 @@ export const handler: Handler = async (event, context) => {
     let totalPublished = 0;
     const length = articles.length;
 
-    // Order has to be reverser to appear in the correct order when posting
+    // Order has to be reversed to appear in the correct order when posting
     for (let i = length - 1; i >= 0; i--) {
       const article = articles[i];
       const exists = await redisClient.retrieve(article.link);

+ 1 - 1
src/portales/latercera/handler.ts

@@ -38,7 +38,7 @@ export const handler: Handler = async (event, context) => {
     let totalPublished = 0;
     const length = articles.length;
 
-    // Order has to be reverser to appear in the correct order when posting
+    // Order has to be reversed to appear in the correct order when posting
     for (let i = length - 1; i >= 0; i--) {
       const article = articles[i];
       const exists = await redisClient.retrieve(article.link);

+ 1 - 1
src/portales/theclinic/handler.ts

@@ -36,7 +36,7 @@ export const handler: Handler = async (event, context) => {
     let totalPublished = 0;
     const length = articles.length;
 
-    // Order has to be reverser to appear in the correct order when posting
+    // Order has to be reversed to appear in the correct order when posting
     for (let i = length - 1; i >= 0; i--) {
       const article = articles[i];
       const exists = await redisClient.retrieve(article.link);