Module: PushmiPullyu

Defined in:
lib/pushmi_pullyu.rb,
lib/pushmi_pullyu/version.rb

Overview

PushmiPullyu main module

Defined Under Namespace

Modules: AIP, Logging Classes: CLI, PreservationQueue, SwiftDepositer

Constant Summary collapse

DEFAULTS =
{
  aip_version: 'lightaip-2.0',
  daemonize: false,
  debug: false,
  logdir: 'log',
  minimum_age: 0,
  monitor: false,
  piddir: 'tmp/pids',
  workdir: 'tmp/work',
  process_name: 'pushmi_pullyu',
  queue_name: 'dev:pmpy_queue',
  ingestion_prefix: 'prod:pmpy_ingest_attempt:',
  ingestion_attempts: 15,
  first_failed_wait: 10,
  redis: {
    url: 'redis://localhost:6379'
  },
  swift: {
    tenant: 'tester',
    username: 'test:tester',
    password: 'testing',
    auth_url: 'http://localhost:8080/auth/v1.0',
    project_name: 'demo',
    project_domain_name: 'default',
    container: 'era',
    auth_version: 'v3',
    user_domain: 'default'
  },
  rollbar: {},
  # rubocop disable: Style/FetchEnvVar
  jupiter: {
    user: ENV.fetch('JUPITER_USER', nil),
    api_key: ENV.fetch('JUPITER_API_KEY', nil),
    jupiter_url: ENV.fetch('JUPITER_URL', nil) || 'http://era.lvh.me:3000/',
    aip_api_path: ENV.fetch('JUPITER_AIP_API_PATH', nil) || 'aip/v1'
  }
  # rubocop enable: Style/FetchEnvVar
}.freeze
VERSION =
'2.1.6'.freeze

Class Method Summary collapse

Class Method Details

.application_log_fileObject



69
70
71
# File 'lib/pushmi_pullyu.rb', line 69

def self.application_log_file
  "#{options[:logdir]}/#{options[:process_name]}.log"
end

.continue_polling?Boolean

Returns:

  • (Boolean)


93
94
95
# File 'lib/pushmi_pullyu.rb', line 93

def self.continue_polling?
  server_running? && !reset_logger?
end

.loggerObject



73
74
75
# File 'lib/pushmi_pullyu.rb', line 73

def self.logger
  PushmiPullyu::Logging.logger
end

.logger=(log) ⇒ Object



77
78
79
# File 'lib/pushmi_pullyu.rb', line 77

def self.logger=(log)
  PushmiPullyu::Logging.logger = log
end

.optionsObject



57
58
59
# File 'lib/pushmi_pullyu.rb', line 57

def self.options
  @options ||= DEFAULTS.dup
end

.options=(opts) ⇒ Object



61
62
63
# File 'lib/pushmi_pullyu.rb', line 61

def self.options=(opts)
  options.deep_merge!(opts)
end

.override_options(opts) ⇒ Object



65
66
67
# File 'lib/pushmi_pullyu.rb', line 65

def self.override_options(opts)
  @options = opts
end

.reset_logger=(status) ⇒ Object



85
86
87
# File 'lib/pushmi_pullyu.rb', line 85

def self.reset_logger=(status)
  @reset_logger = status
end

.reset_logger?Boolean

Returns:

  • (Boolean)


97
98
99
# File 'lib/pushmi_pullyu.rb', line 97

def self.reset_logger?
  @reset_logger
end

.server_running=(status) ⇒ Object



81
82
83
# File 'lib/pushmi_pullyu.rb', line 81

def self.server_running=(status)
  @server_running = status
end

.server_running?Boolean

Returns:

  • (Boolean)


89
90
91
# File 'lib/pushmi_pullyu.rb', line 89

def self.server_running?
  @server_running
end