From 0b5580274d556fadef6d916f1bc319fad62b9d10 Mon Sep 17 00:00:00 2001 From: Ralfs Date: Sat, 10 Apr 2021 13:06:36 +0300 Subject: [PATCH] Heroku --- src/index.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/index.ts b/src/index.ts index 60f6ea5..c2cf4e3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -32,11 +32,6 @@ app.use(mongo({ uri: config.dbConnectionString }, { useUnifiedTopology: true })) initiateTelegramBot(); -router.get('/', async(ctx, next) => { - ctx.res.statusCode = 200; - await next(); -}) - router.post('/alerts', async(ctx, next) => { try { const alert = ctx.request.body; @@ -82,7 +77,7 @@ app.listen(config.port, () => { const runCron = async () => { const mongoConnection = await MongoClient.connect(config.dbConnectionString, { useUnifiedTopology: true }); const db = mongoConnection.db(config.db); - cron.schedule("1 * * * *", async () => { + cron.schedule("* * * * *", async () => { try { const alerts = await db.collection('alerts').find({open: true}).toArray(); const uniqueMangoGroupPks: string[] = [...new Set(alerts.map(alert => alert.mangoGroupPk))];