Fixed ogAgent webhook data error 500
parent
4636a109d8
commit
c33528f78f
|
@ -18,6 +18,10 @@ class CreatePartitionService
|
|||
public function __invoke(array $data, Client $clientEntity): void
|
||||
{
|
||||
foreach ($data['cfg'] as $cfg) {
|
||||
if (!isset($cfg['disk'], $cfg['par'], $cfg['tam'], $cfg['uso'], $cfg['fsi'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$partitionEntity = $this->entityManager->getRepository(Partition::class)
|
||||
->findOneBy(['client' => $clientEntity, 'diskNumber' => $cfg['disk'], 'partitionNumber' => $cfg['par']]);
|
||||
|
||||
|
@ -41,6 +45,7 @@ class CreatePartitionService
|
|||
$partitionEntity->setDiskNumber($cfg['disk']);
|
||||
$partitionEntity->setPartitionNumber($cfg['par']);
|
||||
$partitionEntity->setSize($cfg['tam']);
|
||||
$partitionEntity->setFilesystem($cfg['fsi']);
|
||||
$partitionEntity->setMemoryUsage(((int) $cfg['uso']) * 100);
|
||||
$this->entityManager->persist($partitionEntity);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue