Parcourir la source

其实不用异步

lyhzzz il y a 2 ans
Parent
commit
0862c98c01

+ 17 - 23
src/main/java/com/fdkankan/ucenter/common/utils/AuthLicenseUtil.java

@@ -40,31 +40,25 @@ public class AuthLicenseUtil {
      }
 
     public static void createLicense()  {
-        new Thread() {
-            @Override
-            public void run() {
-                try {
-                    File file = new File(licensePath);
-                    if(!file.exists()){
-                        file.mkdirs();
-                    }
-                    File caches = new File(licensePath + File.separator+ "caches");
-                    FileUtil.del(caches);
-                    File results = new File(licensePath + File.separator+ "results");
-                    FileUtil.del(results);
-
-                    JSONObject licenseDataJson = new JSONObject();
-                    licenseDataJson.put("split_type", "SPLIT_V23");
-                    licenseDataJson.put("skybox_type", "SKYBOX_V5");
-                    FileUtils.writeFile(licensePath + File.separator + "data.json", licenseDataJson.toString());
-                    ShellUtil.execCmd(String.format(cmd,licensePath));
-                }
-                catch (Exception e) {
-                    log.error("createLicense-error:",e);
-                }
+        try {
+            File file = new File(licensePath);
+            if(!file.exists()){
+                file.mkdirs();
             }
-        }.start();
+            File caches = new File(licensePath + File.separator+ "caches");
+            FileUtil.del(caches);
+            File results = new File(licensePath + File.separator+ "results");
+            FileUtil.del(results);
 
+            JSONObject licenseDataJson = new JSONObject();
+            licenseDataJson.put("split_type", "SPLIT_V23");
+            licenseDataJson.put("skybox_type", "SKYBOX_V5");
+            FileUtils.writeFile(licensePath + File.separator + "data.json", licenseDataJson.toString());
+            ShellUtil.execCmd(String.format(cmd,licensePath));
+        }
+        catch (Exception e) {
+            log.error("createLicense-error:",e);
+        }
 
     }