Ejemplo n.º 1
0
  public void onStart(Application app) {
    try {
      // if database is empty, pre-load database
      boolean databaseReset = databaseEmpty();
      if (databaseReset) {
        readInBeaches(); // read in beaches
      }

      // If test mode, make fake data.  Otherwise, start scraping cron job
      if (controllers.Application.config.isTestMode()) {
        if (databaseReset) {
          // makeFakeData();
        }
      } else {
        startScrapingCron();
      }
    } catch (Exception e) {
      // if unable to start the program, print to console and exit.
      e.printStackTrace();
      System.exit(-2);
    }
  }