Skip to content

Commit

Permalink
account for clusters being nil (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
johrstrom authored Feb 9, 2024
1 parent 8c6edda commit 63c2b3c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,22 @@ def version_from_git(dir)
end

get '/clusters' do
@clusters = CLUSTERS.map { |cluster|
@clusters = CLUSTERS.map do |cluster|
if cluster.custom_config[:moab]
MoabShowqClient.new(cluster).setup
else
SlurmSqueueClient.new(cluster).setup
end
}
@gpustats = CLUSTERS.map { |cluster|
end.compact

@gpustats = CLUSTERS.map do |cluster|
if cluster.custom_config[:moab]
GPUClusterStatus.new(cluster)
else
GPUClusterStatusSlurm.new(cluster)
end
}
end.compact

@error_messages = (@clusters.map{ |cluster| cluster.friendly_error_message}).compact

erb :index
Expand Down

0 comments on commit 63c2b3c

Please sign in to comment.