From a0e4c7dc619f0aeafce743bf6e0b90182a7fc012 Mon Sep 17 00:00:00 2001 From: Thassio Victor Date: Fri, 13 Aug 2021 15:46:11 -0300 Subject: [PATCH] [FIX] Apps-Engine's scheduler failing to update run tasks (#22882) Co-authored-by: Douglas Gubert --- app/apps/server/bridges/scheduler.ts | 8 ++++---- package-lock.json | 17 ++++++++--------- package.json | 2 +- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/app/apps/server/bridges/scheduler.ts b/app/apps/server/bridges/scheduler.ts index 6831861b5dba..0676178c84de 100644 --- a/app/apps/server/bridges/scheduler.ts +++ b/app/apps/server/bridges/scheduler.ts @@ -17,12 +17,12 @@ function _callProcessor(processor: Function): (job: { attrs?: { data: object } } // This field is for internal use, no need to leak to app processor delete (data as any).appId; - processor(data); + return processor(data); }; } /** - * Provides the Apps Engine with task scheduling capabilities + * Provides the Apps Engine with task scheduling capabilities. * It uses {@link agenda:github.com/agenda/agenda} as backend */ export class AppSchedulerBridge extends SchedulerBridge { @@ -43,7 +43,7 @@ export class AppSchedulerBridge extends SchedulerBridge { } /** - * Entity that will be run in a job + * Entity that will be run in a job. * @typedef {Object} Processor * @property {string} id The processor's identifier * @property {function} processor The function that will be run on a given schedule @@ -127,7 +127,7 @@ export class AppSchedulerBridge extends SchedulerBridge { } /** - * Schedules a registered processor to run recurrently according to a given interval + * Schedules a registered processor to run recurrently according to a given interval. * * @param {Object} job * @param {string} job.id The processor's id diff --git a/package-lock.json b/package-lock.json index 0599c4e4d5f8..813e2301ba56 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10557,9 +10557,8 @@ "integrity": "sha512-/9aQCnQHF+0IiCl0qhXoK7qs//SwYE7zX8lsr/DNk1BRAHYxeLZPL4pguwK29gUEqasYQjqPtEpDRSWEkdHn9g==" }, "agenda": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/agenda/-/agenda-3.1.0.tgz", - "integrity": "sha512-UtxV/37gkjDYl0H2Lr4hPrBqOhAgtxYeGSYooSd1eyOmXlK1wFkbs77nItOykufFRv6tR6fskWP2RkyBndXYtg==", + "version": "github:RocketChat/agenda#c2cfcc532b8409561104dca980e6adbbcbdf5442", + "from": "github:RocketChat/agenda#3.1.2", "requires": { "cron": "~1.8.0", "date.js": "~0.3.3", @@ -10579,9 +10578,9 @@ } }, "bson": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.5.tgz", - "integrity": "sha512-kDuEzldR21lHciPQAIulLs1LZlCXdLziXI6Mb/TDkwXhb//UORJNPXgcRs2CuO4H0DcMkpfT3/ySsP3unoZjBg==" + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.6.tgz", + "integrity": "sha512-EvVNVeGo4tHxwi8L6bPj3y3itEvStdwvvlojVxxbyYfoaxJ6keLgrTuKdyfEAszFK+H3olzBuafE0yoh0D1gdg==" }, "debug": { "version": "4.1.1", @@ -10605,9 +10604,9 @@ } }, "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" } } }, diff --git a/package.json b/package.json index cf409a3b9bad..d8286a9283ef 100644 --- a/package.json +++ b/package.json @@ -172,7 +172,7 @@ "@slack/client": "^4.12.0", "@types/lodash": "^4.14.171", "adm-zip": "0.4.14", - "agenda": "^3.1.0", + "agenda": "github:RocketChat/agenda#3.1.2", "apn": "2.2.0", "archiver": "^3.1.1", "arraybuffer-to-string": "^1.0.2",