Disable ajax polling for now
This commit is contained in:
parent
ce64132de1
commit
234572f8a6
|
@ -1,4 +1,5 @@
|
||||||
`import Ember from 'ember'`
|
`import Ember from 'ember'`
|
||||||
|
`import config from 'travis/config/environment'`
|
||||||
|
|
||||||
mixin = Ember.Mixin.create
|
mixin = Ember.Mixin.create
|
||||||
polling: Ember.inject.service()
|
polling: Ember.inject.service()
|
||||||
|
@ -6,11 +7,13 @@ mixin = Ember.Mixin.create
|
||||||
didInsertElement: ->
|
didInsertElement: ->
|
||||||
@_super.apply(this, arguments)
|
@_super.apply(this, arguments)
|
||||||
|
|
||||||
|
return unless config.ajaxPolling
|
||||||
@startPolling()
|
@startPolling()
|
||||||
|
|
||||||
willDestroyElement: ->
|
willDestroyElement: ->
|
||||||
@_super.apply(this, arguments)
|
@_super.apply(this, arguments)
|
||||||
|
|
||||||
|
return unless config.ajaxPolling
|
||||||
@stopPolling()
|
@stopPolling()
|
||||||
|
|
||||||
pollModelDidChange: (sender, key, value) ->
|
pollModelDidChange: (sender, key, value) ->
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
`import Ember from 'ember'`
|
`import Ember from 'ember'`
|
||||||
|
`import config from 'travis/config/environment'`
|
||||||
|
|
||||||
service = Ember.Service.extend
|
service = Ember.Service.extend
|
||||||
pollingInterval: 30000
|
pollingInterval: 30000
|
||||||
|
@ -9,6 +10,8 @@ service = Ember.Service.extend
|
||||||
@set('watchedModels', [])
|
@set('watchedModels', [])
|
||||||
@set('sources', [])
|
@set('sources', [])
|
||||||
|
|
||||||
|
return unless config.ajaxPolling
|
||||||
|
|
||||||
interval = setInterval =>
|
interval = setInterval =>
|
||||||
@poll()
|
@poll()
|
||||||
, @get('pollingInterval')
|
, @get('pollingInterval')
|
||||||
|
@ -18,7 +21,8 @@ service = Ember.Service.extend
|
||||||
willDestroy: ->
|
willDestroy: ->
|
||||||
@_super.apply(this, arguments)
|
@_super.apply(this, arguments)
|
||||||
|
|
||||||
clearInterval(@get('interval'))
|
if interval = @get('interval')
|
||||||
|
clearInterval(interval)
|
||||||
|
|
||||||
startPollingHook: (source) ->
|
startPollingHook: (source) ->
|
||||||
sources = @get('sources')
|
sources = @get('sources')
|
||||||
|
|
|
@ -31,7 +31,8 @@ module.exports = function(environment) {
|
||||||
endpoints: {},
|
endpoints: {},
|
||||||
intervals: { updateTimes: 1000 },
|
intervals: { updateTimes: 1000 },
|
||||||
statusPageStatusUrl: 'https://pnpcptp8xh9k.statuspage.io/api/v2/status.json',
|
statusPageStatusUrl: 'https://pnpcptp8xh9k.statuspage.io/api/v2/status.json',
|
||||||
githubOrgsOauthAccessSettingsUrl: 'https://github.com/settings/connections/applications/f244293c729d5066cf27'
|
githubOrgsOauthAccessSettingsUrl: 'https://github.com/settings/connections/applications/f244293c729d5066cf27',
|
||||||
|
ajaxPolling: false
|
||||||
};
|
};
|
||||||
|
|
||||||
if (typeof process !== 'undefined') {
|
if (typeof process !== 'undefined') {
|
||||||
|
|
|
@ -71,5 +71,6 @@ run Travis::Web::App.build(
|
||||||
code_climate: ENV['CODE_CLIMATE'],
|
code_climate: ENV['CODE_CLIMATE'],
|
||||||
code_climate_url: ENV['CODE_CLIMATE_URL'],
|
code_climate_url: ENV['CODE_CLIMATE_URL'],
|
||||||
assets_host: ENV['ASSETS_HOST'],
|
assets_host: ENV['ASSETS_HOST'],
|
||||||
|
ajax_polling: ENV['AJAX_POLLING'],
|
||||||
github_orgs_oauth_access_settings_url: ENV['GITHUB_ORGS_OAUTH_ACCESS_SETTINGS_URL']
|
github_orgs_oauth_access_settings_url: ENV['GITHUB_ORGS_OAUTH_ACCESS_SETTINGS_URL']
|
||||||
)
|
)
|
||||||
|
|
|
@ -199,6 +199,7 @@ class Travis::Web::App
|
||||||
config['codeClimateUrl'] = options[:code_climate_url] if options[:code_climate_url]
|
config['codeClimateUrl'] = options[:code_climate_url] if options[:code_climate_url]
|
||||||
config['charmKey'] = options[:charm_key] if options[:charm_key]
|
config['charmKey'] = options[:charm_key] if options[:charm_key]
|
||||||
config['githubOrgsOauthAccessSettingsUrl'] = options[:github_orgs_oauth_access_settings_url]
|
config['githubOrgsOauthAccessSettingsUrl'] = options[:github_orgs_oauth_access_settings_url]
|
||||||
|
config['ajaxPolling'] = true if options[:ajax_polling]
|
||||||
|
|
||||||
config['endpoints'] = {
|
config['endpoints'] = {
|
||||||
'sshKey' => options[:ssh_key_enabled],
|
'sshKey' => options[:ssh_key_enabled],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user