Fix client not registering when no file in directory #122

Merged
louis_royer merged 1 commits from fix-not-registering into master 5 years ago

@ -50,6 +50,7 @@ public abstract class FileWatcher implements Runnable {
this.server = server; this.server = server;
this.tracker = tracker; this.tracker = tracker;
this.baseDirectory = baseDirectory; this.baseDirectory = baseDirectory;
force = true;
} }
/** FileList getter /** FileList getter

@ -316,25 +316,6 @@ public abstract class TrackerManagement extends ServeErrors implements Runnable
closeHostItemSocket(host); closeHostItemSocket(host);
} catch (EmptyDirectory e) { } catch (EmptyDirectory e) {
writeLog("Empty Directory", LogLevel.Debug); writeLog("Empty Directory", LogLevel.Debug);
try {
synchronized (this) {
while(writeLock.getAndSet(true)) {
this.wait();
}
while(readLock.get() > 0) {
this.wait();
}
if (!hostList.contains(host)) {
hostList.add(host);
}
hostList.remove(host);
writeLock.getAndSet(false);
this.notifyAll();
}
} catch(InterruptedException e2) {
throw new InternalError();
}
writeLog("Received EMPTY DIRECTORY from host " + pd.getHostItem() + ". Aborting.", LogLevel.Action);
} catch (Exception e) { } catch (Exception e) {
// remove from list because list request could not be send // remove from list because list request could not be send
try { try {

Loading…
Cancel
Save