Author: toad
Date: 2009-01-29 17:24:53 +0000 (Thu, 29 Jan 2009)
New Revision: 25368

Modified:
   branches/db4o/freenet/src/freenet/node/NodeClientCore.java
Log:
Remove before running startup hooks, so they can re-add themselves if 
necessary. Re-add on thrown. Note that they won't be re-run before restart in 
any case.


Modified: branches/db4o/freenet/src/freenet/node/NodeClientCore.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/NodeClientCore.java  2009-01-29 
17:23:46 UTC (rev 25367)
+++ branches/db4o/freenet/src/freenet/node/NodeClientCore.java  2009-01-29 
17:24:53 UTC (rev 25368)
@@ -595,11 +595,14 @@
                        RestartDBJob job = 
startupDatabaseJobs[startupDatabaseJobsDone];
                        try {
                                container.activate(job.job, 1);
+                               // Remove before execution, to allow it to 
re-add itself if it wants to 
+                               restartJobsQueue.removeRestartJob(job.job, 
job.prio, container);
                                job.job.run(container, context);
-                               restartJobsQueue.removeRestartJob(job.job, 
job.prio, container);
                                container.commit();
                        } catch (Throwable t) {
                                Logger.error(this, "Caught "+t+" in startup job 
"+job, t);
+                               // Try again next time
+                               restartJobsQueue.queueRestartJob(job.job, 
job.prio, container);
                        }
                        startupDatabaseJobsDone++;
                        if(startupDatabaseJobsDone == 
startupDatabaseJobs.length)

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to