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