added wss tools 6
This commit is contained in:
@@ -214,10 +214,16 @@ class WalletController extends Controller
|
||||
|
||||
$this->validateWithdrawAmount((int) $data['value']);
|
||||
|
||||
$extraNote = trim((string) ($data['extra_note'] ?? ''));
|
||||
if (strlen($extraNote) > 500) {
|
||||
return response()->json(['message' => 'توضیحات اضافی حداکثر ۵۰۰ کاراکتر است'], 422);
|
||||
}
|
||||
|
||||
$Withdraw = Withdraw::create([
|
||||
'customer_id' => auth('customer')->id(),
|
||||
"cash" => $data['value'],
|
||||
"note" => "برداشت ریالی",
|
||||
'extra_note' => $extraNote !== '' ? $extraNote : null,
|
||||
"bank_account_id" => $data['card_id'],
|
||||
'sts' => 1,
|
||||
'type' => 2
|
||||
|
||||
@@ -18,9 +18,7 @@ class PriceStreamController extends Controller
|
||||
abort(404);
|
||||
}
|
||||
|
||||
$host = $service->resolveHost($request);
|
||||
|
||||
return response()->stream(function () use ($service, $host) {
|
||||
return response()->stream(function () use ($service) {
|
||||
@set_time_limit(0);
|
||||
|
||||
if (function_exists('apache_setenv')) {
|
||||
@@ -46,15 +44,13 @@ class PriceStreamController extends Controller
|
||||
$send('last', $last);
|
||||
}
|
||||
|
||||
$lastId = $host !== '' ? $service->currentSeq($host) : 0;
|
||||
$lastId = $service->currentSeq();
|
||||
$heartbeatTicks = 0;
|
||||
|
||||
while (! connection_aborted()) {
|
||||
if ($host !== '') {
|
||||
foreach ($service->consumeSince($host, $lastId) as $event) {
|
||||
$send((string) $event['event'], $event['data']);
|
||||
$lastId = (int) $event['id'];
|
||||
}
|
||||
foreach ($service->consumeSince($lastId) as $event) {
|
||||
$send((string) $event['event'], $event['data']);
|
||||
$lastId = (int) $event['id'];
|
||||
}
|
||||
|
||||
$heartbeatTicks++;
|
||||
|
||||
@@ -22,7 +22,6 @@ use Illuminate\Support\Facades\Mail;
|
||||
use Morilog\Jalali\Jalalian;
|
||||
use App\Services\ConfigService;
|
||||
use App\Services\LivePriceCacheService;
|
||||
use App\Services\PriceBroadcastService;
|
||||
use App\Services\ProductDisplayPriceService;
|
||||
|
||||
|
||||
@@ -133,10 +132,7 @@ class ReportController extends Controller
|
||||
$cache = app(LivePriceCacheService::class);
|
||||
$cache->markTick();
|
||||
|
||||
$result = $cache->put($payload);
|
||||
app(PriceBroadcastService::class)->broadcastAfterPriceUpdate($result, true);
|
||||
|
||||
return $result;
|
||||
return $cache->put($payload);
|
||||
}
|
||||
|
||||
return $payload;
|
||||
|
||||
Reference in New Issue
Block a user