QutBioacoustics/baw-server

View on GitHub
bin/baw-workers

Summary

Maintainability
Test Coverage
#!/usr/bin/env ruby
# frozen_string_literal: true

ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
env = ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'

require 'bundler' # Set up gems listed in the Gemfile.
Bundler.setup(:default, :server, :workers, env.to_sym)

require 'bootsnap'
Bootsnap.setup(
  cache_dir: File.expand_path('../tmp/cache', __dir__), # Path to your cache
  development_mode: ['development', 'test'].include?(env), # Current working environment, e.g. RACK_ENV, RAILS_ENV, etc
  load_path_cache: true, # Optimize the LOAD_PATH with a cache
  # this option has been deprecated
  #autoload_paths_cache: true, # Optimize ActiveSupport autoloads with cache
  compile_cache_iseq: true, # Compile Ruby code into ISeq cache, breaks coverage reporting.
  compile_cache_yaml: true # Compile YAML into a cache
)

require 'rake'

#Rake.application.run ["-f '#{__dir__}/../lib/tasks/run_worker.rake'", *ARGV]

Rake.application
# https://docs.ruby-lang.org/en/2.2.0/Rake/Application.html
Rake.application.init('baw-workers', ARGV)

# our app must execute from root dir - relative paths in settings assume this
Dir.chdir("#{__dir__}/..")

# this allows us to print a list of tasks
Rake::TaskManager.record_task_metadata = true
Rake.load_rakefile("#{__dir__}/../lib/gems/baw-workers/lib/baw_workers/tasks/run_worker.rake")
Rake.application.top_level