Skip to content

Commit

Permalink
add clear cache
Browse files Browse the repository at this point in the history
  • Loading branch information
alnutile committed Jul 29, 2024
1 parent c7c77b6 commit 00bdf9a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions app/Http/Controllers/SettingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use App\Http\Resources\SettingResource;
use App\Models\Setting;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Artisan;

class SettingController extends Controller
{
Expand All @@ -29,7 +30,7 @@ public function updateClaude(Request $request, Setting $setting)
$setting->secrets = $secrets;
$setting->save();
$setting->updateStep($setting);

$this->clearCache();
return back();
}

Expand All @@ -45,7 +46,7 @@ public function updateOllama(Request $request, Setting $setting)
$setting->secrets = $secrets;
$setting->save();
$setting->updateStep($setting);

$this->clearCache();
return back();
}

Expand All @@ -61,7 +62,7 @@ public function updateGroq(Request $request, Setting $setting)
$setting->secrets = $secrets;
$setting->save();
$setting->updateStep($setting);

$this->clearCache();
return back();
}

Expand All @@ -79,7 +80,12 @@ public function updateOpenAi(Request $request, Setting $setting)
$setting->secrets = $secrets;
$setting->save();
$setting->updateStep($setting);
$this->clearCache();

return back();
}

protected function clearCache() {
Artisan::call('optimize:clear');
}
}
2 changes: 1 addition & 1 deletion config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
'prefix' => '',
'prefix_indexes' => true,
'search_path' => 'public',
'sslmode' => 'prefer',
'sslmode' => env('DB_SSLMODE', 'prefer'),
],

'sqlsrv' => [
Expand Down

0 comments on commit 00bdf9a

Please sign in to comment.