Do not send restart events to browser on import.

This commit is contained in:
Martin Edenhofer 2016-05-27 16:25:25 +02:00
parent c2c71ca06d
commit c24b4031fc
2 changed files with 8 additions and 4 deletions

View file

@ -473,9 +473,13 @@ returns
[record1, record2, ...] [record1, record2, ...]
to send no browser reload event, pass false
ObjectManager::Attribute.migration_execute(false)
=end =end
def self.migration_execute def self.migration_execute(send_event = true)
# check if field already exists # check if field already exists
execute_count = 0 execute_count = 0
@ -592,7 +596,7 @@ returns
} }
# sent maintenance message to clients # sent maintenance message to clients
if execute_count != 0 if send_event && execute_count != 0
if ENV['APP_RESTART_CMD'] if ENV['APP_RESTART_CMD']
AppVersion.set(true, 'restart_auto') AppVersion.set(true, 'restart_auto')
sleep 4 sleep 4

View file

@ -456,7 +456,7 @@ module Import::Zendesk
created_by_id: 1, created_by_id: 1,
updated_by_id: 1, updated_by_id: 1,
) )
ObjectManager::Attribute.migration_execute ObjectManager::Attribute.migration_execute(false)
end end
# OAuth # OAuth
@ -1001,7 +1001,7 @@ module Import::Zendesk
# https://developer.zendesk.com/rest_api/docs/core/automations # https://developer.zendesk.com/rest_api/docs/core/automations
def import_automations def import_automations
@client.automations.all! { |zendesk_automation| @client.automations.all! { |_zendesk_automation|
# "url" => "https://example.zendesk.com/api/v2/automations/60037892.json" # "url" => "https://example.zendesk.com/api/v2/automations/60037892.json"
# "id" => 60037892 # "id" => 60037892