Author: j16sdiz
Date: 2008-12-15 04:10:42 +0000 (Mon, 15 Dec 2008)
New Revision: 24340
Modified:
trunk/plugins/XMLSpider/XMLSpider.java
Log:
lessor synchronization
Modified: trunk/plugins/XMLSpider/XMLSpider.java
===================================================================
--- trunk/plugins/XMLSpider/XMLSpider.java 2008-12-15 04:10:33 UTC (rev
24339)
+++ trunk/plugins/XMLSpider/XMLSpider.java 2008-12-15 04:10:42 UTC (rev
24340)
@@ -220,7 +220,7 @@
* Adds the found uri to the list of to-be-retrieved uris. <p>Every usk
uri added as ssk.
* @param uri the new uri that needs to be fetched for further indexing
*/
- public synchronized void queueURI(FreenetURI uri, String comment) {
+ public void queueURI(FreenetURI uri, String comment) {
String sURI = uri.toString();
for (String ext : BADLIST_EXTENSTION)
if (sURI.endsWith(ext))
@@ -236,13 +236,15 @@
catch(Exception e){}
}
- if (getPageByURI(uri) == null) {
- Page page = new Page();
- page.uri = uri.toString();
- page.id = maxPageId.incrementAndGet();
- page.comment = comment;
+ synchronized (this) {
+ if (getPageByURI(uri) == null) {
+ Page page = new Page();
+ page.uri = uri.toString();
+ page.id = maxPageId.incrementAndGet();
+ page.comment = comment;
- db.store(page);
+ db.store(page);
+ }
}
}
_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs