Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bin/file-watcher.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
const chokidar = require('chokidar');

const paths = JSON.parse(process.argv[2]);
const poll = process.argv[3] ? true : false;

const watcher = chokidar.watch(paths, {
ignoreInitial: true,
usePolling: poll,
});

watcher
Expand Down
1 change: 1 addition & 0 deletions src/Commands/Concerns/InteractsWithServers.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public function __call($method, $parameters)
(new ExecutableFinder)->find('node'),
'file-watcher.js',
json_encode(collect(config('octane.watch'))->map(fn ($path) => base_path($path))),
$this->option('poll'),
], realpath(__DIR__.'/../../../bin'), null, null, null))->start();
}

Expand Down
5 changes: 4 additions & 1 deletion src/Commands/StartCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ class StartCommand extends Command implements SignalableCommandInterface
{--task-workers=auto : The number of task workers that should be available to handle tasks}
{--max-requests=500 : The number of requests to process before reloading the server}
{--rr-config= : The path to the RoadRunner .rr.yaml file}
{--watch : Automatically reload the server when the application is modified}';
{--watch : Automatically reload the server when the application is modified}
{--poll : Use file system polling while watching in order to watch files over a network}';

/**
* The command's description.
Expand Down Expand Up @@ -61,6 +62,7 @@ protected function startSwooleServer()
'--task-workers' => $this->option('task-workers'),
'--max-requests' => $this->option('max-requests'),
'--watch' => $this->option('watch'),
'--poll' => $this->option('poll'),
]);
}

Expand All @@ -79,6 +81,7 @@ protected function startRoadRunnerServer()
'--max-requests' => $this->option('max-requests'),
'--rr-config' => $this->option('rr-config'),
'--watch' => $this->option('watch'),
'--poll' => $this->option('poll'),
]);
}

Expand Down
3 changes: 2 additions & 1 deletion src/Commands/StartRoadRunnerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class StartRoadRunnerCommand extends Command implements SignalableCommandInterfa
{--workers=auto : The number of workers that should be available to handle requests}
{--max-requests=500 : The number of requests to process before reloading the server}
{--rr-config= : The path to the RoadRunner .rr.yaml file}
{--watch : Automatically reload the server when the application is modified}';
{--watch : Automatically reload the server when the application is modified}
{--poll : Use file system polling while watching in order to watch files over a network}';

/**
* The command's description.
Expand Down
3 changes: 2 additions & 1 deletion src/Commands/StartSwooleCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ class StartSwooleCommand extends Command implements SignalableCommandInterface
{--workers=auto : The number of workers that should be available to handle requests}
{--task-workers=auto : The number of task workers that should be available to handle tasks}
{--max-requests=500 : The number of requests to process before reloading the server}
{--watch : Automatically reload the server when the application is modified}';
{--watch : Automatically reload the server when the application is modified}
{--poll : Use file system polling while watching in order to watch files over a network}';

/**
* The command's description.
Expand Down