ShokoAnime / ShokoServer

Repository for Shoko Server.
https://shokoanime.com/
MIT License
405 stars 74 forks source link

Drop-Source not observed if Host-Computer is offline at startup of JMM Server #495

Open yhoogi opened 8 years ago

yhoogi commented 8 years ago

Setting Drop-Source: Network Folder on a different host computer; Watch for new files enabled At startup of JMM server Drop-Source is not available (Host Computer offline)

Effect: Drop-Source is not monitored, even if Host Computer comes online later New files in Drop-Source are not recognised and processed

To resolve: Have to restart JMM server

maxpiva commented 8 years ago

This is a Know issue (at least by me :P) if you disconnect and connect a NAS/USB Drive, etc the behavior is the same. The FileSystemWatcher provided with the .NET Framework after initialized, if you disconnect the drive in question and connect it again. The FileSystem Events will not longer be triggered. There is a stackoverflow question about this:

FileSystemWatcher Network Disconnect

We have to make the FileSystemWatcher resilent to network and disconnect/connect events.

maxpiva commented 8 years ago

For Our Info, FileSystemWatcher replacement.

Tamed FileSystemwatcher

hidden4003 commented 7 years ago

Tested with win 10 laptop and win 10 vm, doesn't work. Test used was:

  1. Make sure vm offline, server started, message in log about folder being watched.
  2. Bring VM online, make sure folder is accesible, drop some file. Result - nothing happens. Restart server, drop file, file gets hashed imported.
yhoogi commented 7 years ago

Will this be corrected with v3.8?

Cheers,

da3dsoul commented 7 years ago

Nope! As far as I am aware, it is an issue with the system we use. @maxpiva you posted a possible solution further up. Is that a feasible solution?

maxpiva commented 7 years ago

We already implemented that, i think somehow server is missing a call in StartWatchingFiles.

We need to call for every fsw, the Start Method That will start a timer, that will check the state mount point periodically, and start when needed, i cannot commit any changes right now. (Not in the work computer).