Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117780626
D2560.1775247365.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D2560.1775247365.diff
View Options
diff --git a/src/app/Console/Commands/WalletCharge.php b/src/app/Console/Commands/WalletCharge.php
--- a/src/app/Console/Commands/WalletCharge.php
+++ b/src/app/Console/Commands/WalletCharge.php
@@ -52,7 +52,7 @@
$wallets = Wallet::select('wallets.*')
->join('users', 'users.id', '=', 'wallets.user_id')
->whereNull('users.deleted_at')
- ->get();
+ ->cursor();
}
foreach ($wallets as $wallet) {
diff --git a/src/tests/Feature/Console/WalletChargeTest.php b/src/tests/Feature/Console/WalletChargeTest.php
--- a/src/tests/Feature/Console/WalletChargeTest.php
+++ b/src/tests/Feature/Console/WalletChargeTest.php
@@ -117,16 +117,25 @@
$this->backdateEntitlements($user->entitlements, \Carbon\Carbon::now()->subWeeks(5));
\App\Wallet::where('balance', '<', '0')->update(['balance' => 0]);
+ $user2 = $this->getTestUser('wallet-charge@kolabnow.com');
+ $wallet2 = $user2->wallets()->first();
+ $wallet2->balance = -100;
+ $wallet2->save();
+
Queue::fake();
// Non-existing wallet ID
$this->artisan('wallet:charge')->assertExitCode(0);
- Queue::assertPushed(\App\Jobs\WalletCheck::class, 1);
+ Queue::assertPushed(\App\Jobs\WalletCheck::class, 2);
Queue::assertPushed(\App\Jobs\WalletCheck::class, function ($job) use ($wallet) {
$job_wallet = TestCase::getObjectProperty($job, 'wallet');
return $job_wallet->id === $wallet->id;
});
+ Queue::assertPushed(\App\Jobs\WalletCheck::class, function ($job) use ($wallet2) {
+ $job_wallet = TestCase::getObjectProperty($job, 'wallet');
+ return $job_wallet->id === $wallet2->id;
+ });
Queue::assertPushed(\App\Jobs\WalletCharge::class, 1);
Queue::assertPushed(\App\Jobs\WalletCharge::class, function ($job) use ($wallet) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 3, 8:16 PM (17 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18825411
Default Alt Text
D2560.1775247365.diff (1 KB)
Attached To
Mode
D2560: Fix memory issue in wallet:charge command
Attached
Detach File
Event Timeline