Merge pull request #11462 from backstage/renovate/cron-2.x

fix(deps): update dependency cron to v2
This commit is contained in:
Ben Lambert
2022-05-30 14:16:30 +02:00
committed by GitHub
5 changed files with 30 additions and 25 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/backend-tasks': patch
---
Updated dependency `cron` to `^2.0.0`.
Updated dependency `@types/cron` to `^2.0.0`.
+2 -2
View File
@@ -38,7 +38,7 @@
"@backstage/errors": "^1.0.0",
"@backstage/types": "^1.0.0",
"@types/luxon": "^2.0.4",
"cron": "^1.8.2",
"cron": "^2.0.0",
"knex": "^1.0.2",
"lodash": "^4.17.21",
"luxon": "^2.0.2",
@@ -50,7 +50,7 @@
"devDependencies": {
"@backstage/backend-test-utils": "^0.1.25-next.0",
"@backstage/cli": "^0.17.2-next.0",
"@types/cron": "^1.7.3",
"@types/cron": "^2.0.0",
"wait-for-expect": "^3.0.2"
},
"files": [
@@ -123,7 +123,7 @@ export class LocalTaskWorker {
let dt: number;
if (isCron) {
const nextRun = +new CronTime(settings.cadence).sendAt().toDate();
const nextRun = +new CronTime(settings.cadence).sendAt().toJSDate();
dt = nextRun - Date.now();
} else {
dt =
@@ -175,8 +175,9 @@ export class TaskWorker {
} else if (isCron) {
const time = new CronTime(settings.cadence)
.sendAt()
.add({ seconds: -1 }) // immediately, if "* * * * * *"
.toISOString();
.minus({ seconds: 1 }) // immediately, if "* * * * * *"
.toUTC()
.toISO();
startAt = this.knex.client.config.client.includes('sqlite3')
? this.knex.raw('datetime(?)', [time])
: this.knex.raw(`?`, [time]);
@@ -279,7 +280,7 @@ export class TaskWorker {
let nextRun: Knex.Raw;
if (isCron) {
const time = new CronTime(settings.cadence).sendAt().toISOString();
const time = new CronTime(settings.cadence).sendAt().toUTC().toISO();
this.logger.debug(`task: ${this.taskId} will next occur around ${time}`);
nextRun = this.knex.client.config.client.includes('sqlite3')
? this.knex.raw('datetime(?)', [time])
+17 -19
View File
@@ -5670,13 +5670,13 @@
resolved "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz#6b2c510a7ad7039e98e7b8d3d6598f4359e5c080"
integrity sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==
"@types/cron@^1.7.3":
version "1.7.3"
resolved "https://registry.npmjs.org/@types/cron/-/cron-1.7.3.tgz#993db7d54646f61128c851607b64ba4495deae93"
integrity sha512-iPmUXyIJG1Js+ldPYhOQcYU3kCAQ2FWrSkm1FJPoii2eYSn6wEW6onPukNTT0bfiflexNSRPl6KWmAIqS+36YA==
"@types/cron@^2.0.0":
version "2.0.0"
resolved "https://registry.npmjs.org/@types/cron/-/cron-2.0.0.tgz#4fe75f2720a3b69a1f7b80e656749f4c2c96d727"
integrity sha512-xZM08fqvwIXgghtPVkSPKNgC+JoMQ2OHazEvyTKnNf7aWu1aB6/4lBbQFrb03Td2cUGG7ITzMv3mFYnMu6xRaQ==
dependencies:
"@types/luxon" "*"
"@types/node" "*"
moment ">=2.14.0"
"@types/d3-color@*":
version "3.0.2"
@@ -6155,7 +6155,7 @@
resolved "https://registry.npmjs.org/@types/lunr/-/lunr-2.3.4.tgz#728f445855818fb17776d10ef4678f278072eb03"
integrity sha512-j4x4XJwZvorEUbA519VdQ5b9AOU9TSvfi8tvxMAfP8XzNLtFex7A8vFQwqOx3WACbV0KMXbACV3cZl4/gynQ7g==
"@types/luxon@^2.0.4", "@types/luxon@^2.0.5", "@types/luxon@^2.0.9":
"@types/luxon@*", "@types/luxon@^2.0.4", "@types/luxon@^2.0.5", "@types/luxon@^2.0.9":
version "2.3.2"
resolved "https://registry.npmjs.org/@types/luxon/-/luxon-2.3.2.tgz#8a3f2cdd4858ce698b56cd8597d9243b8e9d3c65"
integrity sha512-WOehptuhKIXukSUUkRgGbj2c997Uv/iUgYgII8U7XLJqq9W2oF0kQ6frEznRQbdurioz+L/cdaIm4GutTQfgmA==
@@ -9989,12 +9989,12 @@ crelt@^1.0.5:
resolved "https://registry.npmjs.org/crelt/-/crelt-1.0.5.tgz#57c0d52af8c859e354bace1883eb2e1eb182bb94"
integrity sha512-+BO9wPPi+DWTDcNYhr/W90myha8ptzftZT+LwcmUbbok0rcP/fequmFYCw8NMoH7pkAZQzU78b3kYrlua5a9eA==
cron@^1.8.2:
version "1.8.2"
resolved "https://registry.npmjs.org/cron/-/cron-1.8.2.tgz#4ac5e3c55ba8c163d84f3407bde94632da8370ce"
integrity sha512-Gk2c4y6xKEO8FSAUTklqtfSr7oTq0CiPQeLBG5Fl0qoXpZyMcj1SG59YL+hqq04bu6/IuEA7lMkYDAplQNKkyg==
cron@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/cron/-/cron-2.0.0.tgz#15c6bf37c1cebf6da1d7a688b9ba1c68338bfe6b"
integrity sha512-RPeRunBCFr/WEo7WLp8Jnm45F/ziGJiHVvVQEBSDTSGu6uHW49b2FOP2O14DcXlGJRLhwE7TIoDzHHK4KmlL6g==
dependencies:
moment-timezone "^0.5.x"
luxon "^1.23.x"
cronstrue@^2.2.0:
version "2.5.0"
@@ -17056,6 +17056,11 @@ lunr@^2.3.9:
resolved "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1"
integrity sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==
luxon@^1.23.x:
version "1.28.0"
resolved "https://registry.npmjs.org/luxon/-/luxon-1.28.0.tgz#e7f96daad3938c06a62de0fb027115d251251fbf"
integrity sha512-TfTiyvZhwBYM/7QdAVDh+7dBTBA29v4ik0Ce9zda3Mnf8on1S5KJI8P2jKFZ8+5C0jhmr0KwJEO/Wdpm0VeWJQ==
luxon@^2.0.2, luxon@^2.3.0, luxon@^2.3.1:
version "2.4.0"
resolved "https://registry.npmjs.org/luxon/-/luxon-2.4.0.tgz#9435806545bb32d4234dab766ab8a3d54847a765"
@@ -18111,14 +18116,7 @@ modify-values@^1.0.0:
resolved "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022"
integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==
moment-timezone@^0.5.x:
version "0.5.34"
resolved "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.34.tgz#a75938f7476b88f155d3504a9343f7519d9a405c"
integrity sha512-3zAEHh2hKUs3EXLESx/wsgw6IQdusOT8Bxm3D9UrHPQR7zlMmzwybC8zHEM1tQ4LJwP7fcxrWr8tuBg05fFCbg==
dependencies:
moment ">= 2.9.0"
"moment@>= 2.9.0", moment@>=2.14.0, moment@^2.27.0, moment@^2.29.1:
moment@^2.27.0, moment@^2.29.1:
version "2.29.2"
resolved "https://registry.npmjs.org/moment/-/moment-2.29.2.tgz#00910c60b20843bcba52d37d58c628b47b1f20e4"
integrity sha512-UgzG4rvxYpN15jgCmVJwac49h9ly9NurikMWGPdVxm8GZD6XjkKPxDTjQQ43gtGgnV3X0cAyWDdP2Wexoquifg==