Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log: fix multi task import logs being mixed up #33

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions app/code/community/Task/Executor/Model/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,12 @@ public function getStepComment()
*/
public function setStepMessage($message)
{
/** @var string $taskId */
$taskId = $this->getTaskId();
/** @var int $stepNumber */
$stepNumber = $this->getStepNumber();
/** @var string $messageKey */
$messageKey = sprintf('message_step_%s', $stepNumber);
$messageKey = sprintf('%s_message_step_%s', $taskId, $stepNumber);
/** @var string[] $stepMessage */
$stepMessage = [
'type' => 'success',
Expand All @@ -292,10 +294,12 @@ public function setStepMessage($message)
*/
public function getStepMessage()
{
/** @var string $taskId */
$taskId = $this->getTaskId();
/** @var int $stepNumber */
$stepNumber = $this->getStepNumber();
/** @var string $messageKey */
$messageKey = sprintf('message_step_%s', $stepNumber);
$messageKey = sprintf('%s_message_step_%s', $taskId, $stepNumber);
/** @var string[] $stepMessage */
$stepMessage = [
'type' => 'success',
Expand All @@ -320,8 +324,12 @@ public function setStepWarning($message)
if (!is_string($message)) {
return;
}
/** @var string $taskId */
$taskId = $this->getTaskId();
/** @var int $stepNumber */
$stepNumber = $this->getStepNumber();
/** @var string $stepKey */
$stepKey = sprintf('warning_step_%s', $this->getStepNumber());
$stepKey = sprintf('%s_warning_step_%s', $taskId, $stepNumber);
/** @var mixed[] $warnings */
$warnings = $this->getStepWarnings();
$warnings[] = [
Expand All @@ -338,8 +346,12 @@ public function setStepWarning($message)
*/
public function getStepWarnings()
{
/** @var string $taskId */
$taskId = $this->getTaskId();
/** @var int $stepNumber */
$stepNumber = $this->getStepNumber();
/** @var string $stepKey */
$stepKey = sprintf('warning_step_%s', $this->getStepNumber());
$stepKey = sprintf('%s_warning_step_%s', $taskId, $stepNumber);
/** @var string[] $warnings */
$warnings = [];
if (!empty($this->getData($stepKey))) {
Expand Down