@ -17,6 +17,7 @@ import com.fr.event.Event;
import com.fr.event.EventDispatcher ;
import com.fr.event.EventDispatcher ;
import com.fr.event.Listener ;
import com.fr.event.Listener ;
import com.fr.event.Null ;
import com.fr.event.Null ;
import com.fr.log.FineLoggerFactory ;
import com.fr.stable.core.UUID ;
import com.fr.stable.core.UUID ;
import com.fr.task.Once ;
import com.fr.task.Once ;
import com.fr.update.delay.DelayHelper ;
import com.fr.update.delay.DelayHelper ;
@ -46,12 +47,14 @@ public class EnvDetectorCenter {
public void on ( Event event , Null param ) {
public void on ( Event event , Null param ) {
// startup 的监听,执行一次即可
// startup 的监听,执行一次即可
EventDispatcher . stopListen ( this ) ;
EventDispatcher . stopListen ( this ) ;
FineLoggerFactory . getLogger ( ) . debug ( "startup complete, start detecting env" ) ;
stop ( ) ;
stop ( ) ;
}
}
} ;
} ;
private final Listener < Workspace > AFTER_SWITCH_LISTENER = new Listener < Workspace > ( ) {
private final Listener < Workspace > AFTER_SWITCH_LISTENER = new Listener < Workspace > ( ) {
@Override
@Override
public void on ( Event event , Workspace param ) {
public void on ( Event event , Workspace param ) {
FineLoggerFactory . getLogger ( ) . debug ( "switch env complete, start detecting env" ) ;
stop ( ) ;
stop ( ) ;
}
}
} ;
} ;
@ -158,6 +161,7 @@ public class EnvDetectorCenter {
. map ( DetectorUtil : : convert2Notification )
. map ( DetectorUtil : : convert2Notification )
. collect ( Collectors . toList ( ) ) ;
. collect ( Collectors . toList ( ) ) ;
if ( Collections . isEmpty ( notificationModels ) ) {
if ( Collections . isEmpty ( notificationModels ) ) {
FineLoggerFactory . getLogger ( ) . debug ( "detector not found any exception" ) ;
return ;
return ;
}
}
@ -169,10 +173,10 @@ public class EnvDetectorCenter {
}
}
NotificationDialog dialog = new NotificationDialog ( properties , notificationModels ) ;
NotificationDialog dialog = new NotificationDialog ( properties , notificationModels ) ;
dialog . open ( ) ;
dialog . open ( ) ;
// 执行完移除
pendingActions . remove ( uuid ) ;
} ) ;
} ) ;
// 执行完移除
pendingActions . remove ( uuid ) ;
} ;
} ;