-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redudant reloads with --watch flag and recommended location of SQLite database #397
Comments
Can you add |
Hey @sybbear. While your issue is straightforward and I'd expect to get the issue you're experiencing I couldn't reproduce the issue. Octane doesn't reload for me upon changes to the database.sqlite file. I also see you've added an invalid Laravel version. 8.68.0 doesn't exists yet. So I suspect something is amis on your end. If you can give me clear step-by-step instructions on how to reproduce the issue I'll take another look. Thanks. |
Hi @driesvints, apologies for delay. Reproducing the issue: Artisan::command('sqlite-write', function () {
\Schema::connection('sqlite')->create('test', function (\Illuminate\Database\Schema\Blueprint $table) {
$table->id();
$table->text('text');
});
DB::connection('sqlite')->table('test')->insert(['text' => 'TestText']);
\Schema::connection('sqlite')->drop('test');
}); |
Having |
@sybbear that won't reload things for other files in |
Got you and thank you for suggesting workaround 👍 |
Description:
This is an issue with default boilerplate code, which causes redundant Octane server reloads with
--watch
flag when using .sqlite database according to Laravel documentation.According to https://laravel.com/docs/8.x/database#sqlite-configuration
And .gitignore in laravel/laravel: https://github.com/laravel/laravel/blob/8.x/database/.gitignore
*.sqlite
database should be in/database
folder.Then watch flag in
config/octane.php
covers watching/database
folder by default:https://github.com/laravel/octane/blob/1.x/config/octane.php#L186
This can potentially cause a significant amount of server reloads on:
--watch
flag is neededAs running
octane:start
command does not automatically tell which files were changed, it is very easy to get confused as to why reloads happen (especially for new developers) on requests that write to the database.Resolution suggestions
/database
dir (These are supposed to be run from CLI anyway).php
filesThe text was updated successfully, but these errors were encountered: