mirror of
https://github.com/koel/koel
synced 2024-11-24 21:23:06 +00:00
Merge pull request #248 from UrbanCMC/inotifywait_create
Support INotifyWait CREATE event
This commit is contained in:
commit
89b8e37880
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