|
@@ -5,6 +5,7 @@ import config from "./config";
|
|
|
import { handler as chilecultura } from "./portales/chilecultura/handler";
|
|
import { handler as chilecultura } from "./portales/chilecultura/handler";
|
|
|
import { handler as ciper } from "./portales/ciper/handler";
|
|
import { handler as ciper } from "./portales/ciper/handler";
|
|
|
import { handler as codexverde } from "./portales/codexverde/handler";
|
|
import { handler as codexverde } from "./portales/codexverde/handler";
|
|
|
|
|
+import { handler as contrapoder } from "./portales/contrapoder/handler";
|
|
|
// import { handler as cooperativa } from "./portales/cooperativa/handler";
|
|
// import { handler as cooperativa } from "./portales/cooperativa/handler";
|
|
|
import { handler as df } from "./portales/df/handler";
|
|
import { handler as df } from "./portales/df/handler";
|
|
|
import { handler as elciudadano } from "./portales/elciudadano/handler";
|
|
import { handler as elciudadano } from "./portales/elciudadano/handler";
|
|
@@ -29,9 +30,9 @@ const context: Context = {
|
|
|
awsRequestId: "",
|
|
awsRequestId: "",
|
|
|
logGroupName: "",
|
|
logGroupName: "",
|
|
|
logStreamName: "",
|
|
logStreamName: "",
|
|
|
- done: () => {},
|
|
|
|
|
- fail: () => {},
|
|
|
|
|
- succeed: () => {},
|
|
|
|
|
|
|
+ done: () => { },
|
|
|
|
|
+ fail: () => { },
|
|
|
|
|
+ succeed: () => { },
|
|
|
getRemainingTimeInMillis: () => 1
|
|
getRemainingTimeInMillis: () => 1
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -39,6 +40,7 @@ const portalsHandlers = {
|
|
|
"chilecultura": chilecultura,
|
|
"chilecultura": chilecultura,
|
|
|
"ciper": ciper,
|
|
"ciper": ciper,
|
|
|
"codexverde": codexverde,
|
|
"codexverde": codexverde,
|
|
|
|
|
+ "contrapoder": contrapoder,
|
|
|
// "cooperativa": cooperativa,
|
|
// "cooperativa": cooperativa,
|
|
|
"df": df,
|
|
"df": df,
|
|
|
"elciudadano": elciudadano,
|
|
"elciudadano": elciudadano,
|
|
@@ -52,17 +54,18 @@ const portalsHandlers = {
|
|
|
"latercera": latercera,
|
|
"latercera": latercera,
|
|
|
// "metrodesantiago": metrodesantiago,
|
|
// "metrodesantiago": metrodesantiago,
|
|
|
"tarreo": tarreo,
|
|
"tarreo": tarreo,
|
|
|
- "theclinic": theclinic,
|
|
|
|
|
|
|
+ "theclinic": theclinic
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const activePortalsHandlers: Array<Handler> = Object.keys(portalsHandlers)
|
|
const activePortalsHandlers: Array<Handler> = Object.keys(portalsHandlers)
|
|
|
- .filter((portalName) => ! config.DEVELOP || config.DEV_ACTIVE_PORTALS.includes(portalName))
|
|
|
|
|
|
|
+ .filter((portalName) => !config.DEVELOP || config.DEV_ACTIVE_PORTALS.includes(portalName))
|
|
|
.map((portalName) => portalsHandlers[portalName]);
|
|
.map((portalName) => portalsHandlers[portalName]);
|
|
|
|
|
|
|
|
const cooldown = 10000; // 10 seconds
|
|
const cooldown = 10000; // 10 seconds
|
|
|
-async function main (): Promise<void> {
|
|
|
|
|
|
|
+async function main(): Promise<void> {
|
|
|
|
|
+ console.log(`${activePortalsHandlers}`)
|
|
|
for (const portalHandler of activePortalsHandlers) {
|
|
for (const portalHandler of activePortalsHandlers) {
|
|
|
- await portalHandler(null, context, () => {});
|
|
|
|
|
|
|
+ await portalHandler(null, context, () => { });
|
|
|
await new Promise((resolve) => setTimeout(resolve, cooldown));
|
|
await new Promise((resolve) => setTimeout(resolve, cooldown));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|