- while(true) {
- try { Thread.sleep(500); } catch (Exception e) { }
- try {
- File f = new File(Mailbox.STORAGE_ROOT + "/restart");
- if (f.exists()) {
- Log.error("RESTART", "restarting...");
- System.exit(0);
- }
- } catch (Exception e) { Log.error(this, e); }
- }
- }
- }.start();
+ try {
+ File f = new File(Mailbox.STORAGE_ROOT + "/restart");
+ if (f.exists()) {
+ Log.error("RESTART", "restarting...");
+ System.exit(0);
+ }
+ } catch (Exception e) { Log.error(this, e); }
+ cron.executeLater(500, this);
+ } });
+