mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-26 13:36:15 +00:00
Clear up webhooks
This commit is contained in:
@@ -42,6 +42,7 @@ class JournalDestroyService
|
||||
*/
|
||||
public function destroy(TransactionJournal $journal): void
|
||||
{
|
||||
Log::debug(sprintf('Now in %s', __METHOD__));
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($journal->transactions()->get() as $transaction) {
|
||||
Log::debug(sprintf('Will now delete transaction #%d', $transaction->id));
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace FireflyIII\Services\Internal\Destroy;
|
||||
|
||||
use FireflyIII\Events\DestroyedTransactionGroup;
|
||||
use FireflyIII\Models\TransactionGroup;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
* Class TransactionGroupDestroyService
|
||||
@@ -38,6 +39,7 @@ class TransactionGroupDestroyService
|
||||
*/
|
||||
public function destroy(TransactionGroup $transactionGroup): void
|
||||
{
|
||||
Log::debug(sprintf('Now in %s', __METHOD__));
|
||||
/** @var JournalDestroyService $service */
|
||||
$service = app(JournalDestroyService::class);
|
||||
foreach ($transactionGroup->transactionJournals as $journal) {
|
||||
|
||||
@@ -56,7 +56,8 @@ class StandardWebhookSender implements WebhookSenderInterface
|
||||
// have the signature generator generate a signature. If it fails, the error thrown will
|
||||
// end up in send() to be caught.
|
||||
$signatureGenerator = app(SignatureGeneratorInterface::class);
|
||||
|
||||
$this->message->sent = true;
|
||||
$this->message->save();
|
||||
try {
|
||||
$signature = $signatureGenerator->generate($this->message);
|
||||
} catch (FireflyException $e) {
|
||||
@@ -108,7 +109,6 @@ class StandardWebhookSender implements WebhookSenderInterface
|
||||
$client = new Client();
|
||||
try {
|
||||
$res = $client->request('POST', $this->message->webhook->url, $options);
|
||||
$this->message->sent = true;
|
||||
} catch (RequestException $e) {
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
@@ -127,6 +127,7 @@ class StandardWebhookSender implements WebhookSenderInterface
|
||||
|
||||
return;
|
||||
}
|
||||
$this->message->sent = true;
|
||||
$this->message->save();
|
||||
|
||||
Log::debug(sprintf('Webhook message #%d was sent. Status code %d', $this->message->id, $res->getStatusCode()));
|
||||
|
||||
Reference in New Issue
Block a user