Page MenuHomePhorge

D5026.1775359105.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D5026.1775359105.diff

diff --git a/src/app/Jobs/WalletCheck.php b/src/app/Jobs/WalletCheck.php
--- a/src/app/Jobs/WalletCheck.php
+++ b/src/app/Jobs/WalletCheck.php
@@ -69,16 +69,13 @@
return null;
}
- if ($this->wallet->chargeEntitlements() > 0) {
- // We make a payment when there's a charge. If for some reason the
- // payment failed we can't just throw here, as another execution of this job
- // will not re-try the payment. So, we attempt a payment in a separate job.
- try {
- $this->topUpWallet();
- } catch (\Exception $e) {
- \Log::error("Failed to top-up wallet {$this->walletId}: " . $e->getMessage());
- WalletCharge::dispatch($this->wallet->id);
- }
+ $this->wallet->chargeEntitlements();
+ try {
+ $this->topUpWallet();
+ } catch (\Exception $e) {
+ \Log::error("Failed to top-up wallet {$this->walletId}: " . $e->getMessage());
+ // Spawn a job to try again
+ WalletCharge::dispatch($this->wallet->id);
}
if ($this->wallet->balance >= 0) {

File Metadata

Mime Type
text/plain
Expires
Sun, Apr 5, 3:18 AM (12 h, 31 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18832171
Default Alt Text
D5026.1775359105.diff (1 KB)

Event Timeline