Skip to content

Commit

Permalink
Start movement detector in data service only after migrations complete
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalidze committed May 7, 2016
1 parent aa81f9f commit a656101
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ public void init() throws ServletException {
} catch (Exception e) {
throw new RuntimeException("Unable to perform DB migrations", e);
}

/**
* Start movement detector
*/
movementDetector.start();
}

EntityManager getSessionEntityManager() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public class MovementDetector extends ScheduledTask {
@Inject
public MovementDetector(Provider<EntityManager> entityManagerProvider) {
this.entityManagerProvider = entityManagerProvider;
}

public void start() {
scheduler.scheduleWithFixedDelay(this, 0, 1, TimeUnit.MINUTES);
}

Expand Down

0 comments on commit a656101

Please sign in to comment.