mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-24 03:57:27 +08:00
feat: introduce WebSocket sync for XBoard nodes
- Implement Workerman-based `xboard:ws-server` for real-time node synchronization. - Support custom routes, outbounds, and certificate configurations via JSON. - Optimize scheduled tasks with `lazyById` to minimize memory footprint. - Enhance reactivity using Observers for `Plan`, `Server`, and `ServerRoute`. - Expand protocol support for `httpupgrade`, `h2`, and `mieru`.
This commit is contained in:
@@ -104,9 +104,9 @@ class CheckCommission extends Command
|
||||
$commissionBalance = $order->commission_balance * ($commissionShareLevels[$l] / 100);
|
||||
if (!$commissionBalance) continue;
|
||||
if ((int)admin_setting('withdraw_close_enable', 0)) {
|
||||
$inviter->balance = $inviter->balance + $commissionBalance;
|
||||
$inviter->increment('balance', $commissionBalance);
|
||||
} else {
|
||||
$inviter->commission_balance = $inviter->commission_balance + $commissionBalance;
|
||||
$inviter->increment('commission_balance', $commissionBalance);
|
||||
}
|
||||
if (!$inviter->save()) {
|
||||
DB::rollBack();
|
||||
|
||||
@@ -43,12 +43,11 @@ class CheckOrder extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
ini_set('memory_limit', -1);
|
||||
$orders = Order::whereIn('status', [Order::STATUS_PENDING, Order::STATUS_PROCESSING])
|
||||
Order::whereIn('status', [Order::STATUS_PENDING, Order::STATUS_PROCESSING])
|
||||
->orderBy('created_at', 'ASC')
|
||||
->get();
|
||||
foreach ($orders as $order) {
|
||||
OrderHandleJob::dispatch($order->trade_no);
|
||||
}
|
||||
->lazyById(200)
|
||||
->each(function ($order) {
|
||||
OrderHandleJob::dispatch($order->trade_no);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,15 +38,14 @@ class CheckTicket extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
ini_set('memory_limit', -1);
|
||||
$tickets = Ticket::where('status', 0)
|
||||
Ticket::where('status', 0)
|
||||
->where('updated_at', '<=', time() - 24 * 3600)
|
||||
->where('reply_status', 0)
|
||||
->get();
|
||||
foreach ($tickets as $ticket) {
|
||||
if ($ticket->user_id === $ticket->last_reply_user_id) continue;
|
||||
$ticket->status = Ticket::STATUS_CLOSED;
|
||||
$ticket->save();
|
||||
}
|
||||
->lazyById(200)
|
||||
->each(function ($ticket) {
|
||||
if ($ticket->user_id === $ticket->last_reply_user_id) return;
|
||||
$ticket->status = Ticket::STATUS_CLOSED;
|
||||
$ticket->save();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,11 +32,11 @@ class Kernel extends ConsoleKernel
|
||||
// v2board
|
||||
$schedule->command('xboard:statistics')->dailyAt('0:10')->onOneServer();
|
||||
// check
|
||||
$schedule->command('check:order')->everyMinute()->onOneServer();
|
||||
$schedule->command('check:commission')->everyMinute()->onOneServer();
|
||||
$schedule->command('check:ticket')->everyMinute()->onOneServer();
|
||||
$schedule->command('check:order')->everyMinute()->onOneServer()->withoutOverlapping(5);
|
||||
$schedule->command('check:commission')->everyMinute()->onOneServer()->withoutOverlapping(5);
|
||||
$schedule->command('check:ticket')->everyMinute()->onOneServer()->withoutOverlapping(5);
|
||||
// reset
|
||||
$schedule->command('reset:traffic')->everyMinute()->onOneServer();
|
||||
$schedule->command('reset:traffic')->everyMinute()->onOneServer()->withoutOverlapping(10);
|
||||
$schedule->command('reset:log')->daily()->onOneServer();
|
||||
// send
|
||||
$schedule->command('send:remindMail', ['--force'])->dailyAt('11:30')->onOneServer();
|
||||
|
||||
Reference in New Issue
Block a user