Do not check key existence for job manager

This commit is contained in:
Pavel 2020-07-22 15:23:52 +03:00 committed by GitHub
parent 5886df2cc2
commit a06074a978
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 19 deletions

View File

@ -1,3 +1,6 @@
## v3.1.1
* Улучшена работа джобов
## v3.1.0 ## v3.1.0
* Поддержка смены клиента в заказе * Поддержка смены клиента в заказе

View File

@ -1 +1 @@
3.1.0 3.1.1

View File

@ -326,10 +326,8 @@ class RetailcrmCli
*/ */
public static function clearCurrentJob($job) public static function clearCurrentJob($job)
{ {
if (Configuration::hasKey(self::CURRENT_TASK_CLI)) { if (is_null($job) || self::getCurrentJob() == $job) {
if (is_null($job) || self::getCurrentJob() == $job) { return Configuration::deleteByName(self::CURRENT_TASK_CLI);
return Configuration::deleteByName(self::CURRENT_TASK_CLI);
}
} }
return true; return true;

View File

@ -351,10 +351,8 @@ class RetailcrmJobManager
*/ */
public static function clearCurrentJob($job) public static function clearCurrentJob($job)
{ {
if (Configuration::hasKey(self::CURRENT_TASK)) { if (is_null($job) || self::getCurrentJob() == $job) {
if (is_null($job) || self::getCurrentJob() == $job) { return Configuration::deleteByName(self::CURRENT_TASK);
return Configuration::deleteByName(self::CURRENT_TASK);
}
} }
return true; return true;
@ -368,15 +366,8 @@ class RetailcrmJobManager
*/ */
public static function reset() public static function reset()
{ {
$result = true; $result = Configuration::deleteByName(self::CURRENT_TASK);
$result = $result && Configuration::deleteByName(self::LAST_RUN_NAME);
if (Configuration::hasKey(self::CURRENT_TASK)) {
$result = Configuration::deleteByName(self::CURRENT_TASK);
}
if (Configuration::hasKey(self::LAST_RUN_NAME)) {
$result = $result && Configuration::deleteByName(self::LAST_RUN_NAME);
}
self::unlock(); self::unlock();

View File

@ -117,7 +117,7 @@ class RetailCRM extends Module
{ {
$this->name = 'retailcrm'; $this->name = 'retailcrm';
$this->tab = 'export'; $this->tab = 'export';
$this->version = '3.1.0'; $this->version = '3.1.1';
$this->author = 'DIGITAL RETAIL TECHNOLOGIES SL'; $this->author = 'DIGITAL RETAIL TECHNOLOGIES SL';
$this->displayName = $this->l('retailCRM'); $this->displayName = $this->l('retailCRM');
$this->description = $this->l('Integration module for retailCRM'); $this->description = $this->l('Integration module for retailCRM');