From 352ffd7aa808bcd050c288435a50a745f759f38e Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 9 Feb 2016 01:32:55 +0100 Subject: [PATCH] Removed not necessary thread and code cleanup. --- .../javascripts/app/controllers/import_zendesk.coffee | 6 +----- lib/import/otrs.rb | 8 +++----- lib/import/zendesk.rb | 3 ++- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/app/assets/javascripts/app/controllers/import_zendesk.coffee b/app/assets/javascripts/app/controllers/import_zendesk.coffee index e0f1519cc..a94f5631c 100644 --- a/app/assets/javascripts/app/controllers/import_zendesk.coffee +++ b/app/assets/javascripts/app/controllers/import_zendesk.coffee @@ -151,11 +151,7 @@ class Index extends App.ControllerContent success: (data, status, xhr) => if data.result is 'import_done' - delay = 0 - if @Config.get('developer_mode') is true - delay = 5000 - - @delay(window.location.reload, delay) + window.location.reload() return if data.result is 'error' diff --git a/lib/import/otrs.rb b/lib/import/otrs.rb index 27a6e4a5b..230c49345 100644 --- a/lib/import/otrs.rb +++ b/lib/import/otrs.rb @@ -440,11 +440,9 @@ module Import::OTRS } sleep 2 - # start thread to import data + # start import data begin - import_thread = Thread.new { - Import::OTRS.start - } + Import::OTRS.start rescue => e status_update_thread.exit status_update_thread.join @@ -457,7 +455,7 @@ module Import::OTRS Cache.write('import:state', result, expires_in: 10.hours) return false end - import_thread.join + sleep 16 # wait until new finished import state is on client status_update_thread.exit status_update_thread.join diff --git a/lib/import/zendesk.rb b/lib/import/zendesk.rb index e4aa41140..a2e4a46d7 100644 --- a/lib/import/zendesk.rb +++ b/lib/import/zendesk.rb @@ -75,7 +75,7 @@ module Import::Zendesk } sleep 2 - # start thread to import data + # start import data begin Import::Zendesk.start rescue => e @@ -90,6 +90,7 @@ module Import::Zendesk Cache.write('import:state', result, expires_in: 10.hours) return false end + sleep 16 # wait until new finished import state is on client status_update_thread.exit status_update_thread.join