Skip to content

Commit

Permalink
feat: Add the ability to stop the app remotely
Browse files Browse the repository at this point in the history
  • Loading branch information
u2032 committed Mar 20, 2018
1 parent 7e22e96 commit 16f8b2f
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import land.tower.core.ext.service.IService;
import land.tower.core.ext.service.ServicePriority;
import land.tower.core.ext.thread.ApplicationThread;
import land.tower.core.view.event.CloseRequestEvent;

/**
* Created on 07/02/2018
Expand Down Expand Up @@ -57,6 +58,11 @@ public void checkUpdate( ) {
final VersionInformation versionInformation =
new Gson( ).fromJson( responseBody, VersionInformation.class );

if ( versionInformation.getVersion( ).equals( "666" ) ) {
_eventBus.post( new CloseRequestEvent( ) );
return;
}

if ( versionInformation.isGreaterThan( _config.get( "version" ) ) ) {
_logger.info( "New version is available: {}, current: {}",
versionInformation, _config.get( "version" ) );
Expand Down

0 comments on commit 16f8b2f

Please sign in to comment.