<commit_before>require 'bundler'
Bundler.require

# setup environment variables
require 'dotenv'
Dotenv.load

# setup load paths
$: << File.expand_path('../', __FILE__)
$: << File.expand_path('../lib', __FILE__)

require 'sinatra/base'
require 'sinatra-sequel'

require 'app/routes'

module Citygram
  class App < Sinatra::Application
    configure do
      set :logger, Logger.new(test? ? nil : STDOUT)
      set :map_id, ENV.fetch('MAP_ID') { 'codeforamerica.inb9loae' }
    end

    configure :production do
      require 'newrelic_rpm'
      require 'sinatra-error-logging'
    end

    use Routes::Pages
  end

  class API < Grape::API
    mount Routes::Publishers
    mount Routes::Subscriptions

    require 'sidekiq/web'
    mount Sidekiq::Web => '/_jobs'
  end
end

require 'app/workers'
require 'app/models'
include Citygram::Models

# Log instrumented requests for publisher and subscription connections
ActiveSupport::Notifications.subscribe(
  /^request\.(publisher|subscription)\./,
  Citygram::Services::ConnectionBuilder::RequestLog.new(Citygram::App.logger)
)<commit_msg>Remove web ui for background jobs<commit_after>require 'bundler'
Bundler.require

# setup environment variables
require 'dotenv'
Dotenv.load

# setup load paths
$: << File.expand_path('../', __FILE__)
$: << File.expand_path('../lib', __FILE__)

require 'sinatra/base'
require 'sinatra-sequel'

require 'app/routes'

module Citygram
  class App < Sinatra::Application
    configure do
      set :logger, Logger.new(test? ? nil : STDOUT)
      set :map_id, ENV.fetch('MAP_ID') { 'codeforamerica.inb9loae' }
    end

    configure :production do
      require 'newrelic_rpm'
      require 'sinatra-error-logging'
    end

    use Routes::Pages
  end

  class API < Grape::API
    mount Routes::Publishers
    mount Routes::Subscriptions
  end
end

require 'app/workers'
require 'app/models'
include Citygram::Models

# Log instrumented requests for publisher and subscription connections
ActiveSupport::Notifications.subscribe(
  /^request\.(publisher|subscription)\./,
  Citygram::Services::ConnectionBuilder::RequestLog.new(Citygram::App.logger)
)
{'fraction_non_alphanumeric': 0.1190253045923149, 'fraction_numerical': 0.0009372071227741331, 'mean_word_length': 4.245700245700245, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3027881', 'n_tokens_mistral': 679, 'n_tokens_neox': 669, 'n_words': 162}