diff src/luan/host/WebHandler.java @ 1400:221eedb0f54e

fix inner class gc bug
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 13 Sep 2019 05:05:51 -0600
parents 002152af497a
children 27efb1fcbcb5
line wrap: on
line diff
--- a/src/luan/host/WebHandler.java	Wed Sep 11 16:28:38 2019 -0600
+++ b/src/luan/host/WebHandler.java	Fri Sep 13 05:05:51 2019 -0600
@@ -24,7 +24,7 @@
 	private static final DomainHandler.Factory factory = new DomainHandler.Factory() {
 		public Handler newHandler(String domain) {
 			File dir = new File(sitesDir,domain);
-			if( !dir.exists() /* && !recover(dir) */ )
+			if( !dir.exists() )
 				return null;
 			String dirStr = dir.toString();
 
@@ -34,7 +34,7 @@
 			Luan luan = new Luan();
 			Log4j.newLoggerRepository(luan);
 			initLuan(luan,dirStr,domain);
-			return new LuanHandler(luan);
+			return new LuanHandler(luan,domain);
 		}
 	};
 
@@ -59,26 +59,6 @@
 		return luanHandler.call_rpc(fnName,args);
 	}
 
-/*
-	private static boolean recover(File dir) {
-		File backups = new File(dir.getParentFile().getParentFile(),"backups");
-		if( !backups.exists() )
-			return false;
-		String name = dir.getName();
-		File from = null;
-		for( File backup : backups.listFiles() ) {
-			File d = new File(backup,"current/"+name);
-			if( d.exists() && (from==null || from.lastModified() < d.lastModified()) )
-				from = d;
-		}
-		if( from == null )
-			return false;
-		if( !from.renameTo(dir) )
-			throw new RuntimeException("couldn't rename "+from+" to "+dir);
-		logger.info("recovered "+name+" from "+from);
-		return true;
-	}
-*/
 	private static void initLuan(Luan luan,String dir,String domain) {
 		security(luan,dir);
 		try {