Skip to content

Commit

Permalink
update endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
rromanchuk committed Dec 30, 2023
1 parent 614be59 commit fd9226c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 22 deletions.
6 changes: 3 additions & 3 deletions personal/app/controllers/tds/batches_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ def debug

def ingest
if allowed_to?(:ingest?, current_user, with: BatchPolicy)
Pireps::Ingest.async_call
Metars::Ingest.async_call
Tafs::Ingest.async_call
Pireps::Ingest.call
Metars::Ingest.call
Tafs::Ingest.call
redirect_to tds_batches_path, notice: 'Ingesting data...'
else
redirect_to tds_batches_path, notice: 'Not authorized'
Expand Down
6 changes: 3 additions & 3 deletions personal/app/models/tds/batch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ def process_batch!

case report_type
when 'aircraftreports'
Tds::Pireps::Process.async_call(id)
Tds::Pireps::Process.call(id)
when 'metars'
Tds::Metars::Process.async_call(id)
Tds::Metars::Process.call(id)
when 'tafs'
Tds::Tafs::Process.async_call(id)
Tds::Tafs::Process.call(id)
end
end
end
Expand Down
6 changes: 1 addition & 5 deletions personal/app/services/tds/tafs/ingest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ def report_type
end

def file_type
'cache.xml'
end

def content_type
'text/xml'
'cache.xml.gz'
end
end
end
Expand Down
4 changes: 3 additions & 1 deletion personal/app/views/tds/pireps/_pirep.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
Station
</td>
<td>
<%= link_to pirep.station.code, tds_station_pireps_path(pirep.station), data: {turbo_action: :advance, turbo_frame: :pireps} %>
<% if pirep.station %>
<%= link_to pirep.station&.code, tds_station_pireps_path(pirep.station), data: {turbo_action: :advance, turbo_frame: :pireps} %>
<% end %>
</td>
</tr>
</tbody>
Expand Down
20 changes: 10 additions & 10 deletions personal/config/schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ query_stats_worker:
queue: "default"
description: "Capture query stats"

# metars:
# cron: "*/30 * * * *"
# class: "IngestMetarsWorker"
# queue: "default"
# description: "Metars pipeline"
metars:
cron: "*/30 * * * *"
class: "IngestMetarsWorker"
queue: "default"
description: "Metars pipeline"

# tafs:
# cron: "*/30 * * * *"
# class: "IngestTafsWorker"
# queue: "default"
# description: "Tafs pipeline"
tafs:
cron: "*/30 * * * *"
class: "IngestTafsWorker"
queue: "default"
description: "Tafs pipeline"

pireps:
cron: "*/15 * * * *"
Expand Down

0 comments on commit fd9226c

Please sign in to comment.