mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-24 03:57:27 +08:00
feat: add AnyTLS support and improve system functionality
- Add AnyTLS protocol support - Add system logs viewing in admin panel - Refactor client subscription delivery code - Refactor hook mechanism - Add plugin support for Shadowsocks protocol - Add CSV export option for batch user creation - Fix mobile admin login page width display issue
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Services\Plugin\HookManager;
|
||||
use App\Services\UpdateService;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Laravel\Octane\Facades\Octane;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Laravel\Octane\Events\WorkerStarting;
|
||||
|
||||
class OctaneServiceProvider extends ServiceProvider
|
||||
{
|
||||
public function register(): void
|
||||
{
|
||||
}
|
||||
|
||||
public function boot(): void
|
||||
{
|
||||
if ($this->app->runningInConsole()) {
|
||||
return;
|
||||
}
|
||||
if ($this->app->bound('octane')) {
|
||||
$this->app['events']->listen(WorkerStarting::class, function () {
|
||||
app(UpdateService::class)->updateVersionCache();
|
||||
HookManager::reset();
|
||||
});
|
||||
}
|
||||
// 每半钟执行一次调度检查
|
||||
Octane::tick('scheduler', function () {
|
||||
$lock = Cache::lock('scheduler-lock', 30);
|
||||
|
||||
if ($lock->get()) {
|
||||
try {
|
||||
Artisan::call('schedule:run');
|
||||
} finally {
|
||||
$lock->release();
|
||||
}
|
||||
}
|
||||
})->seconds(30);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user