<commit_before>require 'sinatra/base'

module Tranz
  
  class WebService < Sinatra::Base
    set :sessions, false
    set :run, false
    
    post '/job' do
      p params
      job = Job.new(params)
      unless job.valid?
        halt 400, 'Invalid job specification'
      end
      Application.get.queue.push(job)
      201
    end
    
  end
  
end<commit_msg>Web service logging.<commit_after>require 'sinatra/base'

module Tranz
  
  class WebService < Sinatra::Base
    set :sessions, false
    set :run, false
    
    post '/job' do
      logger.info "Handling job: #{params.inspect}"
      job = Job.new(params)
      unless job.valid?
        halt 400, 'Invalid job specification'
      end
      Application.get.queue.push(job)
      201
    end
    
    private
    
      def logger
        return @logger ||= Application.get.logger
      end
    
  end
  
end
{'fraction_non_alphanumeric': 0.08551881413911061, 'fraction_numerical': 0.013683010262257697, 'mean_word_length': 1.9662162162162162, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '6780950', 'n_tokens_mistral': 287, 'n_tokens_neox': 274, 'n_words': 76}