From 83eb252e82a564526c0ea381d2c1e87cab22cb81 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 27 Aug 2020 15:01:31 +0300 Subject: [PATCH] update cron expression --- application/Espo/Core/CronManager.php | 4 +- composer.json | 2 +- composer.lock | 98 +++++++++++++++------------ 3 files changed, 59 insertions(+), 45 deletions(-) diff --git a/application/Espo/Core/CronManager.php b/application/Espo/Core/CronManager.php index cb3c76fd1e..9d1923a1ec 100644 --- a/application/Espo/Core/CronManager.php +++ b/application/Espo/Core/CronManager.php @@ -49,6 +49,8 @@ use Espo\Entities\Job as JobEntity; use Spatie\Async\Pool as AsyncPool; +use Cron\CronExpression; + use Espo\Core\Exceptions\NotFound; use Espo\Core\Exceptions\Error; @@ -448,7 +450,7 @@ class CronManager $nextDate = date('Y-m-d H:i:s'); } else { try { - $cronExpression = \Cron\CronExpression::factory($scheduling); + $cronExpression = CronExpression::factory($scheduling); } catch (\Exception $e) { $GLOBALS['log']->error( 'CronManager (ScheduledJob ['.$scheduledJob->id.']): Scheduling string error - '. $e->getMessage() . '.' diff --git a/composer.json b/composer.json index 8e1b2f2cbb..dae08977e7 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "slim/slim": "4.5.*", "slim/psr7": "*", "psr/log": "1.1.*", - "mtdowling/cron-expression": "1.0.*", + "dragonmantank/cron-expression": "^3", "laminas/laminas-mail": "2.10.0", "laminas/laminas-ldap": "2.*", "laminas/laminas-servicemanager": "3.3.2", diff --git a/composer.lock b/composer.lock index 8d1bc4feb4..acde59ed25 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c09d145889a2915ac555bae3e93ae880", + "content-hash": "4871cde6703d73bd860f1f88c6e0d983", "packages": [ { "name": "cboden/ratchet", @@ -638,6 +638,60 @@ ], "time": "2013-01-12T18:59:04+00:00" }, + { + "name": "dragonmantank/cron-expression", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/dragonmantank/cron-expression.git", + "reference": "fa4e95ff5a7f1d62c3fbc05c32729b7f3ca14b52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/fa4e95ff5a7f1d62c3fbc05c32729b7f3ca14b52", + "reference": "fa4e95ff5a7f1d62c3fbc05c32729b7f3ca14b52", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "replace": { + "mtdowling/cron-expression": "^1.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.11", + "phpunit/phpunit": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Cron\\": "src/Cron/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Tankersley", + "email": "chris@ctankersley.com", + "homepage": "https://github.com/dragonmantank" + } + ], + "description": "CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due", + "keywords": [ + "cron", + "schedule" + ], + "funding": [ + { + "url": "https://github.com/dragonmantank", + "type": "github" + } + ], + "time": "2020-08-21T02:30:13+00:00" + }, { "name": "evenement/evenement", "version": "v3.0.1", @@ -1567,48 +1621,6 @@ ], "time": "2016-07-02T14:02:10+00:00" }, - { - "name": "mtdowling/cron-expression", - "version": "v1.0.3", - "source": { - "type": "git", - "url": "https://github.com/mtdowling/cron-expression.git", - "reference": "a47ac8d5ec15049013792401af5a4d13e3dbe7f6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mtdowling/cron-expression/zipball/a47ac8d5ec15049013792401af5a4d13e3dbe7f6", - "reference": "a47ac8d5ec15049013792401af5a4d13e3dbe7f6", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "type": "library", - "autoload": { - "psr-0": { - "Cron": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due", - "keywords": [ - "cron", - "schedule" - ], - "abandoned": "dragonmantank/cron-expression", - "time": "2013-11-23T19:48:39+00:00" - }, { "name": "nesbot/carbon", "version": "2.26.0",