Skip to content

Commit 92e51f1

Browse files
committed
move recreate datetime object to entity
1 parent 328c799 commit 92e51f1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Command/CronProcessCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Shapecode\Bundle\CronBundle\Command;
66

7-
use DateTime;
87
use Doctrine\ORM\EntityManagerInterface;
98
use Psr\Clock\ClockInterface;
109
use RuntimeException;
@@ -137,7 +136,7 @@ private function recordJobResult(
137136
$timeTaken,
138137
$statusCode,
139138
$buffer,
140-
DateTime::createFromImmutable($this->clock->now()),
139+
$this->clock->now(),
141140
);
142141

143142
$this->entityManager->persist($result);

src/Entity/CronJobResult.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Shapecode\Bundle\CronBundle\Entity;
66

7+
use DateTime;
78
use DateTimeInterface;
89
use Doctrine\DBAL\Types\Types;
910
use Doctrine\ORM\Mapping as ORM;
@@ -41,7 +42,7 @@ public function __construct(
4142
$this->statusCode = $statusCode;
4243
$this->output = $output;
4344
$this->cronJob = $cronJob;
44-
$this->runAt = $runAt;
45+
$this->runAt = DateTime::createFromInterface($runAt);
4546
}
4647

4748
public function getRunAt(): DateTimeInterface

0 commit comments

Comments
 (0)