From 3e942c3a7e7e0f5fb2bbe771ddebd68ce3ddeb24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karlo=20Miku=C5=A1?= Date: Mon, 9 Dec 2024 16:45:07 +0100 Subject: [PATCH] Fix build --- app/Providers/AppServiceProvider.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index ffc5b7df..12ebe6cb 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -2,7 +2,9 @@ namespace Kami\Cocktail\Providers; +use Throwable; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\Log; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider @@ -24,10 +26,16 @@ public function register() */ public function boot() { - DB::statement(' - PRAGMA temp_store = memory; - PRAGMA cache_size = -20000; - PRAGMA mmap_size = 2147483648; - '); + if (DB::getDriverName() === 'sqlite') { + try { + DB::statement(' + PRAGMA temp_store = memory; + PRAGMA cache_size = -20000; + PRAGMA mmap_size = 2147483648; + '); + } catch (Throwable $e) { + Log::warning('Unable to connect to DB setup PRAGMAs'); + } + } } }