Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "make xdmod auto-login timeout configurable" #607

Merged
merged 1 commit into from
Jul 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/dashboard/app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function installSettingHandlers(name) {
}


function promiseLoginToXDMoD(xdmodUrl, timeoutms){
function promiseLoginToXDMoD(xdmodUrl){
return new Promise(function(resolve, reject){

var promise_to_receive_message_from_iframe = new Promise(function(resolve, reject){
Expand Down Expand Up @@ -116,7 +116,7 @@ function promiseLoginToXDMoD(xdmodUrl, timeoutms){
})
.then(() => {
return Promise.race([promise_to_receive_message_from_iframe, new Promise(function(resolve, reject){
setTimeout(reject, timeoutms, new Error('Login failed: Timeout waiting for login to complete'));
setTimeout(reject, 5000, new Error('Login failed: Timeout waiting for login to complete'));
})]);
})
.then(() => {
Expand All @@ -129,7 +129,7 @@ function promiseLoginToXDMoD(xdmodUrl, timeoutms){
}

var promiseLoggedIntoXDMoD = (function(){
return _.memoize(function(xdmodUrl, timeoutms = 5000){
return _.memoize(function(xdmodUrl){
return fetch(xdmodUrl + '/rest/v1/users/current', { credentials: 'include' })
.then(response => response.ok ? Promise.resolve() : promiseLoginToXDMoD(xdmodUrl))
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ render_jobs_template({nodata: true, msg: 'LOADING...'});
render_core_hours_template({nodata: true, msg: 'LOADING...'});

var xdmodUrl = '<%= Configuration.xdmod_host %>';
promiseLoggedIntoXDMoD(xdmodUrl, <%= Configuration.xdmod_login_timeout %>)
promiseLoggedIntoXDMoD(xdmodUrl)
.then(() => fetch(jobsUrl, { credentials: 'include' }))
.then(response => response.ok ? Promise.resolve(response) : Promise.reject(new Error(response.statusText)))
.then(response => response.json())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ var render_template = function(context){
render_template({loading: true});

var xdmodUrl = '<%= Configuration.xdmod_host %>';
promiseLoggedIntoXDMoD(xdmodUrl, <%= Configuration.xdmod_login_timeout %>)
promiseLoggedIntoXDMoD(xdmodUrl)
.then(() => fetch(jobsUrl, { credentials: 'include' }))
.then(response => response.ok ? Promise.resolve(response) : Promise.reject(new Error(response.statusText)))
.then(response => response.json())
Expand Down
8 changes: 1 addition & 7 deletions apps/dashboard/config/configuration_singleton.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,12 @@ def balance_threshold
ENV.fetch("OOD_BALANCE_THRESHOLD", 0).to_f
end

# The XDMoD host
# The XMoD host
# @return [String, null] the host, or null if not set
def xdmod_host
ENV["OOD_XDMOD_HOST"]
end

# The XDMoD login timeout in milliseconds
# @return [String] the number of milliseconds before timing out auto-login
def xdmod_login_timeout
ENV['OOD_XDMOD_LOGIN_TIMEOUT'] || '5000'
end

# Whether or not XDMoD integration is enabled
# @return [Boolean]
def xdmod_integration_enabled?
Expand Down