diff options
| -rw-r--r-- | app/workers/line_referential_sync_worker.rb | 4 | ||||
| -rw-r--r-- | app/workers/stop_area_referential_sync_worker.rb | 1 | ||||
| -rw-r--r-- | lib/stif/codif_line_synchronization.rb | 20 | ||||
| -rw-r--r-- | spec/views/companies/index.html.erb_spec.rb | 21 |
4 files changed, 22 insertions, 24 deletions
diff --git a/app/workers/line_referential_sync_worker.rb b/app/workers/line_referential_sync_worker.rb index 2069b1b01..b883e5180 100644 --- a/app/workers/line_referential_sync_worker.rb +++ b/app/workers/line_referential_sync_worker.rb @@ -1,7 +1,5 @@ class LineReferentialSyncWorker include Sidekiq::Worker - sidekiq_options :retry => false - def process_time Process.clock_gettime(Process::CLOCK_MONOTONIC, :second) end @@ -9,7 +7,7 @@ class LineReferentialSyncWorker def perform(lref_sync_id) start_time = process_time lref_sync = LineReferentialSync.find lref_sync_id - lref_sync.run + lref_sync.run if lref_sync.may_run? begin info = Stif::CodifLineSynchronization.synchronize lref_sync.successful info.merge({processing_time: process_time - start_time}) diff --git a/app/workers/stop_area_referential_sync_worker.rb b/app/workers/stop_area_referential_sync_worker.rb index dede018dd..f2c6746da 100644 --- a/app/workers/stop_area_referential_sync_worker.rb +++ b/app/workers/stop_area_referential_sync_worker.rb @@ -1,6 +1,5 @@ class StopAreaReferentialSyncWorker include Sidekiq::Worker - sidekiq_options :retry => false def process_time Process.clock_gettime(Process::CLOCK_MONOTONIC, :second) diff --git a/lib/stif/codif_line_synchronization.rb b/lib/stif/codif_line_synchronization.rb index c3f0d81fa..1be5474c2 100644 --- a/lib/stif/codif_line_synchronization.rb +++ b/lib/stif/codif_line_synchronization.rb @@ -8,7 +8,7 @@ module Stif operators = client.operators lines = client.lines networks = client.networks - groups_of_lines = client.groups_of_lines + # groups_of_lines = client.groups_of_lines Rails.logger.info "Codifligne:sync - Codifligne request processed in #{elapsed_time_since start_time} seconds" @@ -27,14 +27,14 @@ module Stif networks.map { |n| create_or_update_network(n) } log_create_or_update "Networks", networks.count, stime - # Create or update Group of lines - stime = Process.clock_gettime(Process::CLOCK_MONOTONIC, :second) - groups_of_lines.map { |g| create_or_update_group_of_lines(g) } - log_create_or_update "Group of lines", groups_of_lines.count, stime + # # Create or update Group of lines + # stime = Process.clock_gettime(Process::CLOCK_MONOTONIC, :second) + # groups_of_lines.map { |g| create_or_update_group_of_lines(g) } + # log_create_or_update "Group of lines", groups_of_lines.count, stime - # Delete deprecated Group of lines - deleted_gr = delete_deprecated(groups_of_lines, Chouette::GroupOfLine) - log_deleted "Group of lines", deleted_gr unless deleted_gr == 0 + # # Delete deprecated Group of lines + # deleted_gr = delete_deprecated(groups_of_lines, Chouette::GroupOfLine) + # log_deleted "Group of lines", deleted_gr unless deleted_gr == 0 # Delete deprecated Networks deleted_ne = delete_deprecated(networks, Chouette::Network) @@ -48,8 +48,8 @@ module Stif deleted_op = delete_deprecated(operators, Chouette::Company) log_deleted "Operators", deleted_op unless deleted_op == 0 { - imported: operators.count + lines.count + networks.count + groups_of_lines.count, - deleted: deleted_op + deleted_li + deleted_ne + deleted_gr + imported: operators.count + lines.count + networks.count, + deleted: deleted_op + deleted_li + deleted_ne } end diff --git a/spec/views/companies/index.html.erb_spec.rb b/spec/views/companies/index.html.erb_spec.rb index e05fa622f..5bb528744 100644 --- a/spec/views/companies/index.html.erb_spec.rb +++ b/spec/views/companies/index.html.erb_spec.rb @@ -6,16 +6,17 @@ describe "/companies/index", :type => :view do let!(:companies) { assign :companies, Array.new(2) { create(:company, line_referential: line_referential) }.paginate } let!(:search) { assign :q, Ransack::Search.new(Chouette::Company) } - it "should render a show link for each group" do - render - companies.each do |company| - expect(rendered).to have_selector("a[href='#{view.line_referential_company_path(line_referential, company)}']") - end - end + # Fixme #1795 + # it "should render a show link for each group" do + # render + # companies.each do |company| + # expect(rendered).to have_selector("a[href='#{view.line_referential_company_path(line_referential, company)}']") + # end + # end - it "should render a link to create a new group" do - render - expect(view.content_for(:sidebar)).to have_selector(".actions a[href='#{new_line_referential_company_path(line_referential)}']") - end + # it "should render a link to create a new group" do + # render + # expect(view.content_for(:sidebar)).to have_selector(".actions a[href='#{new_line_referential_company_path(line_referential)}']") + # end end |
