fix for the network image sync bug

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7059 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 14 years ago
parent 7aa860c505
commit 6e4d2f0800

@ -26,6 +26,8 @@
import java.util.concurrent.Semaphore;
import net.yacy.kelondro.logging.Log;
import de.anomic.http.server.RequestHeader;
import de.anomic.search.Switchboard;
import de.anomic.search.SwitchboardConstants;
@ -55,6 +57,7 @@ public class NetworkPicture {
sync.acquire();
if (buffer != null && !authorized && timeSeconds - lastAccessSeconds < 2) {
//System.out.println("*** NetworkPicture: cache hit (2)");
sync.release();
return buffer;
}
int width = 768;
@ -93,10 +96,11 @@ public class NetworkPicture {
if (maxCount > 10000) maxCount = 10000;
buffer = new EncodedImage(NetworkGraph.getNetworkPicture(sb.peers, 10000, width, height, passiveLimit, potentialLimit, maxCount, coronaangle, communicationTimeout, env.getConfig(SwitchboardConstants.NETWORK_NAME, "unspecified"), env.getConfig("network.unit.description", "unspecified"), bgcolor).getImage(), "png");
lastAccessSeconds = System.currentTimeMillis() / 1000;
sync.release();
} catch (InterruptedException e) {
if (sync.availablePermits() == 0) sync.release();
} catch (Exception e) {
Log.logException(e);
}
sync.release();
return buffer;
}

Loading…
Cancel
Save