<commit_before>require 'sidekiq/web'
Sidekiq::Web.set :session_secret, Rails.application.secrets[:secret_token]
Sidekiq::Web.set :sessions, Rails.application.config.session_options

# used to authenticate the user in sidekiq-web
class AdminConstraint
  def matches?(request)
    return false unless request.session[:user_id]
    # todo user = User.find request.session[:user_id]
    # todo user && user.admin?
  end
end

Rails.application.routes.draw do
  mount Sidekiq::Web => '/sidekiq', :constraints => AdminConstraint.new

  root 'home#index'
end<commit_msg>add scheduler to sidekiq web, comment admin constraint<commit_after>require 'sidekiq/web'
require 'sidekiq-scheduler/web'

Sidekiq::Web.set :session_secret, Rails.application.secrets[:secret_token]
Sidekiq::Web.set :sessions, Rails.application.config.session_options

# used to authenticate the user in sidekiq-web
class AdminConstraint
  def matches?(request)
    return false unless request.session[:user_id]
    # todo user = User.find request.session[:user_id]
    # todo user && user.admin?
  end
end

Rails.application.routes.draw do
  mount Sidekiq::Web => '/sidekiq' # todo , :constraints => AdminConstraint.new

  root 'home#index'
end
{'fraction_non_alphanumeric': 0.10945273631840796, 'fraction_numerical': 0.0, 'mean_word_length': 5.221649484536083, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '913932', 'n_tokens_mistral': 388, 'n_tokens_neox': 381, 'n_words': 93}