mirror of
https://github.com/koel/koel
synced 2024-11-24 21:23:06 +00:00
Support INotifyWait CREATE event
INotifyWait's CLOSE_WRITE and MOVED_TO events don't work on all operating systems. For those, the CREATE event looks like the best option.
This commit is contained in:
parent
b0a7329a57
commit
b6e44a116d
1 changed files with 3 additions and 2 deletions
|
@ -40,7 +40,8 @@ class InotifyWatchRecord extends WatchRecord implements WatchRecordInterface
|
|||
|
||||
/**
|
||||
* Determine if the object has just been created or modified.
|
||||
* For our purpose, we DON'T watch the CREATE event, because CLOSE_WRITE should be enough.
|
||||
* For our purpose, we watch both the CREATE abd the CLOSE_WRITE event, because some operating
|
||||
* systems only support CREATE, but not CLOSE_WRITE and MOVED_TO.
|
||||
* Additionally, a MOVED_TO (occurred after the object has been moved/renamed to another location
|
||||
* **under our watched directory**) should be considered as "modified" also.
|
||||
*
|
||||
|
@ -48,7 +49,7 @@ class InotifyWatchRecord extends WatchRecord implements WatchRecordInterface
|
|||
*/
|
||||
public function isNewOrModified()
|
||||
{
|
||||
return $this->eventExists('CLOSE_WRITE') || $this->eventExists('MOVED_TO');
|
||||
return $this->eventExists('CLOSE_WRITE') || $this->eventExists('CREATE') || $this->eventExists('MOVED_TO');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue