Skip to content

Commit

Permalink
Access the FOLIO database url through the environment settings
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Jul 5, 2023
1 parent 8441f3e commit 0c874ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ environments:
morison:
kafka_topic: marc_morison
folio_test:
database_url: <%= ENV['DATABASE_URL'] %>
processes: 1
kafka_topic: marc_folio_test
4 changes: 2 additions & 2 deletions script/process_folio_postgres_to_kafka.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
Utils.logger.info "Found last_date in #{state_file}: #{last_date}" if last_date

last_response_date = Traject::FolioPostgresReader.new(nil,
'postgres.url': ENV.fetch('DATABASE_URL')).last_response_date
'postgres.url': Utils.env_config.database_url).last_response_date

shards = if Utils.env_config.processes.to_i > 1
step = Utils.env_config.step_size || 0x0100
Expand All @@ -43,7 +43,7 @@
attempts ||= 1
begin
reader = Traject::FolioPostgresReader.new(nil, 'folio.updated_after': last_date&.utc&.iso8601,
'postgres.url': ENV.fetch('DATABASE_URL'), 'postgres.sql_filters': sql_filter)
'postgres.url': Utils.env_config.database_url, 'postgres.sql_filters': sql_filter)
Traject::FolioKafkaExtractor.new(reader:, kafka: Utils.kafka, topic: Utils.env_config.kafka_topic).process!
rescue PG::Error => e
raise(e) if attempts > 5
Expand Down

0 comments on commit 0c874ac

Please sign in to comment.