Commit 87451675fe5e4b75554d82921f1fd8ddba614c38
1 parent
f6935232
29.06.16
Showing
2 changed files
with
11 additions
and
11 deletions
Show diff stats
common/modules/product/models/Import.php
@@ -476,9 +476,9 @@ class Import extends Model { | @@ -476,9 +476,9 @@ class Import extends Model { | ||
476 | 476 | ||
477 | fclose ($handle); | 477 | fclose ($handle); |
478 | 478 | ||
479 | -// if ($result['end']) { | ||
480 | -// unlink(Yii::getAlias('@uploadDir') .'/'. Yii::getAlias('@uploadFileProducts')); | ||
481 | -// } | 479 | + if ($result['end']) { |
480 | + unlink(Yii::getAlias('@uploadDir') .'/'. Yii::getAlias('@uploadFileProducts')); | ||
481 | + } | ||
482 | 482 | ||
483 | return $result; | 483 | return $result; |
484 | } | 484 | } |
console/controllers/ImportController.php
@@ -33,16 +33,16 @@ class ImportController extends Controller { | @@ -33,16 +33,16 @@ class ImportController extends Controller { | ||
33 | } | 33 | } |
34 | 34 | ||
35 | public function actionProducts() { | 35 | public function actionProducts() { |
36 | -// if (file_exists(Yii::getAlias('@uploadDir/goProducts.lock'))) { | ||
37 | -// $this->errors[] = 'Task already executed'; | ||
38 | -// return Controller::EXIT_CODE_ERROR; | ||
39 | -// } | ||
40 | -// $ff = fopen(Yii::getAlias('@uploadDir/goProducts.lock'), 'w+'); | ||
41 | -// fclose($ff); | 36 | + if (file_exists(Yii::getAlias('@uploadDir/goProducts.lock'))) { |
37 | + $this->errors[] = 'Task already executed'; | ||
38 | + return Controller::EXIT_CODE_ERROR; | ||
39 | + } | ||
40 | + $ff = fopen(Yii::getAlias('@uploadDir/goProducts.lock'), 'w+'); | ||
41 | + fclose($ff); | ||
42 | $model = new Import(); | 42 | $model = new Import(); |
43 | $model->goProducts(0, null); | 43 | $model->goProducts(0, null); |
44 | -// unlink(Yii::getAlias('@uploadDir/goProducts.lock')); | ||
45 | -// return Controller::EXIT_CODE_NORMAL; | 44 | + unlink(Yii::getAlias('@uploadDir/goProducts.lock')); |
45 | + return Controller::EXIT_CODE_NORMAL; | ||
46 | } | 46 | } |
47 | 47 | ||
48 | public function actionPrices() { | 48 | public function actionPrices() { |