Author: toad
Date: 2008-07-23 20:23:11 +0000 (Wed, 23 Jul 2008)
New Revision: 21354

Modified:
   branches/db4o/freenet/src/freenet/client/async/ClientRequestScheduler.java
Log:
Deactivation. Don't deactivate for nonpersistent requests. Logging.

Modified: 
branches/db4o/freenet/src/freenet/client/async/ClientRequestScheduler.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/ClientRequestScheduler.java  
2008-07-23 20:22:28 UTC (rev 21353)
+++ branches/db4o/freenet/src/freenet/client/async/ClientRequestScheduler.java  
2008-07-23 20:23:11 UTC (rev 21354)
@@ -827,6 +827,7 @@
                                                container.activate(req, 1);
                                                if(req == null) continue;
                                                
persistentCooldownQueue.removeKey(key, req, req.getCooldownWakeupByKey(key, 
container), container);
+                                               container.deactivate(req, 1);
                                        }
                                }
                                // Call the callbacks on the database executor 
thread, because the first thing
@@ -900,7 +901,7 @@

                public void run(ObjectContainer container, ClientContext 
context) {
                        if(moveKeysFromCooldownQueue(persistentCooldownQueue, 
true, selectorContainer) ||
-                                       
moveKeysFromCooldownQueue(transientCooldownQueue, true, selectorContainer))
+                                       
moveKeysFromCooldownQueue(transientCooldownQueue, false, selectorContainer))
                                starter.wakeUp();
                }

@@ -935,7 +936,8 @@
                                if(logMINOR) Logger.minor(this, "Restoring key 
but no keys queued?? for "+key);
                                continue;
                        } else {
-                               if(gets != null)
+                               if(gets != null) {
+                                       if(logMINOR) Logger.minor(this, 
"Restoring keys for persistent jobs...");
                                for(int i=0;i<gets.length;i++) {
                                        if(persistent)
                                                container.activate(gets[i], 1);
@@ -953,7 +955,10 @@
                                                container.deactivate(req, 1);
                                        }
                                }
-                               if(transientGets != null)
+                               }
+                               if(transientGets != null) {
+                                       if(gets != null) {
+                                               if(logMINOR) Logger.minor(this, 
"Restoring keys for transient jobs...");
                                for(int i=0;i<transientGets.length;i++) {
                                        GotKeyListener got = transientGets[i];
                                        SendableGet req = got.getRequest(key, 
null);
@@ -962,6 +967,8 @@
                                        }
                                        req.requeueAfterCooldown(key, now, 
container, clientContext);
                                }
+                               }
+                               }
                        }
                        if(persistent)
                                container.deactivate(key, 5);


Reply via email to