We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
FswatchDriver
1 parent e9abeb1 commit d9f70a0Copy full SHA for d9f70a0
publish/watcher.php
@@ -19,4 +19,5 @@
19
'file' => ['.env'],
20
'scan_interval' => 2000,
21
],
22
+ 'ext' => ['.php', '.env'],
23
];
src/Driver/FswatchDriver.php
@@ -44,16 +44,16 @@ public function watch(Channel $channel): void
44
45
while (! $channel->isClosing()) {
46
$ret = fread($pipes[1], 8192);
47
- Coroutine::create(function () use ($ret, $channel) {
48
- if (is_string($ret)) {
+ if (is_string($ret) && $ret !== '') {
+ Coroutine::create(function () use ($ret, $channel) {
49
$files = array_filter(explode("\n", $ret));
50
foreach ($files as $file) {
51
if (Str::endsWith($file, $this->option->getExt())) {
52
$channel->push($file);
53
}
54
55
- }
56
- });
+ });
+ }
57
58
59
0 commit comments