- Minors fixes
This commit is contained in:
parent
8de8aafa84
commit
f1e9dddf5e
@ -14,7 +14,7 @@ namespace Negundo\Client {
|
||||
|
||||
protected Util\DumpHandler $dumpHandler;
|
||||
|
||||
public function __construct(SoftwareConfig $config, ? DataInterface $dataManipulator = null, Transport\TransportInterface $transport = null)
|
||||
public function __construct(SoftwareConfig $config, ? DataInterface $dataManipulator = null, ? Transport\TransportInterface $transport = null)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->transport = $transport ?: new Transport\Curl();
|
||||
|
@ -14,7 +14,7 @@ namespace Negundo\Client {
|
||||
|
||||
protected SoftwareConfig $config;
|
||||
|
||||
public function __construct(SoftwareConfig $config, ? DataInterface $dataManipulator = null, Transport\TransportInterface $transport = null)
|
||||
public function __construct(SoftwareConfig $config, ? DataInterface $dataManipulator = null, ? Transport\TransportInterface $transport = null)
|
||||
{
|
||||
$this->config = $config;
|
||||
|
||||
@ -30,13 +30,13 @@ namespace Negundo\Client {
|
||||
$report = $this->taskHandler->sendReport($message, $title, $data, $events);
|
||||
|
||||
// Make sure not to spam the server if an ErrorMessage or Exception was already sent (like inside a loop)
|
||||
$dumpHash = $this->taskHandler->hash($report);
|
||||
$taskHash = $this->taskHandler->hash($report);
|
||||
|
||||
if ( $this->sent[$dumpHash] ?? false ) {
|
||||
if ( $this->sent[$taskHash] ?? false ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$this->sent[$dumpHash] = true;
|
||||
$this->sent[$taskHash] = true;
|
||||
|
||||
return $this->transport->push($this->config->url('task/report'), $report);
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ namespace Negundo\Client\Task;
|
||||
|
||||
enum StatusEnum : string
|
||||
{
|
||||
case New = "new";
|
||||
case Failed = "failed";
|
||||
case Warning = "warning";
|
||||
case Completed = "completed";
|
||||
|
Loading…
x
Reference in New Issue
Block a user