r26614 - trunk/freenet/src/freenet/node/fcp

[email protected]
Newsgroups gmane.network.freenet.cvs
Message-ID <[email protected]>
Author: toad
Date: 2009-04-07 20:28:16 +0000 (Tue, 07 Apr 2009)
New Revision: 26614

Modified:
   trunk/freenet/src/freenet/node/fcp/ClientRequest.java
Log:
Don't restart non-persistent requests on the database thread


Modified: trunk/freenet/src/freenet/node/fcp/ClientRequest.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/ClientRequest.java	2009-04-07 15:59:46 UTC (rev 26613)
+++ trunk/freenet/src/freenet/node/fcp/ClientRequest.java	2009-04-07 20:28:16 UTC (rev 26614)
@@ -6,6 +6,7 @@
 import java.net.MalformedURLException;
 import freenet.client.async.ClientRequester;
 import freenet.keys.FreenetURI;
+import freenet.node.PrioRunnable;
 import freenet.node.RequestClient;
 import freenet.support.Fields;
 import freenet.support.LogThresholdCallback;
@@ -431,10 +432,11 @@
 		fs.put(name, bucket.toFieldSet());
 	}
 
-	public void restartAsync(FCPServer server) {
+	public void restartAsync(final FCPServer server) {
 		synchronized(this) {
 			this.started = false;
 		}
+		if(persistenceType == PERSIST_FOREVER) {
 		server.core.clientContext.jobRunner.queue(new DBJob() {
 
 			public void run(ObjectContainer container, ClientContext context) {
@@ -444,6 +446,19 @@
 			}
 			
 		}, NativeThread.HIGH_PRIORITY, false);
+		} else {
+			server.core.getExecutor().execute(new PrioRunnable() {
+
+				public int getPriority() {
+					return NativeThread.NORM_PRIORITY;
+				}
+
+				public void run() {
+					restart(null, server.core.clientContext);
+				}
+				
+			}, "Restart request");
+		}
 	}
 
 	/**
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.