Skip to content

Commit aea9936

Browse files
committed
Fixed gridstat -f
1 parent c0da993 commit aea9936

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Unreleased
1111
- Fixed systemd startup script
1212
- Fixed notifications
1313
- Fixed OAR_AUTO_RESUBMIT events (resubmit id could be missed)
14+
- Fixed gridstat -f
1415

1516
version 3.2.0
1617
-------------

api/cigri-api.rb

+11-11
Original file line numberDiff line numberDiff line change
@@ -729,19 +729,19 @@ def get_formated_jobs(id, limit, offset)
729729

730730
items = []
731731
tasks.each do |task|
732-
if task['queued_cluster'] and not task['state']
733-
task['state']="queued"
734-
task['cluster_id']=task['queued_cluster']
732+
if task[:queued_cluster] and not task[:state]
733+
task[:state]="queued"
734+
task[:cluster_id]=task[:queued_cluster]
735735
end
736736
items << {
737-
:id => task['id'],
738-
:name => task['name'],
739-
:parameters => task['param'],
740-
:cluster => CLUSTER_NAMES[task['cluster_id']],
741-
:cigri_job_id => task['cigri_job_id'],
742-
:remote_id => task['remote_id'],
743-
:state => task['state'] || :pending,
744-
:href => to_url("campaigns/#{id}/jobs/#{task['id']}")
737+
:id => task[:id],
738+
:name => task[:name],
739+
:parameters => task[:param],
740+
:cluster => CLUSTER_NAMES[task[:cluster_id]],
741+
:cigri_job_id => task[:cigri_job_id],
742+
:remote_id => task[:remote_id],
743+
:state => task[:state] || :pending,
744+
:href => to_url("campaigns/#{id}/jobs/#{task[:id]}")
745745
}
746746
end
747747

lib/cigri-iolib.rb

+6-3
Original file line numberDiff line numberDiff line change
@@ -843,9 +843,12 @@ def get_campaign_tasks(dbh, id, limit, offset)
843843
OFFSET ?"
844844

845845
res = []
846-
dbh.execute(query, id, limit, offset).as(:Struct).fetch(:all).each do |row|
847-
res.append(row.to_h)
846+
sth = dbh.execute(query, id, limit, offset)
847+
sth.as(:Struct).fetch(:all).each do |row|
848+
res << row.to_h
848849
end
850+
sth.finish
851+
IOLIBLOGGER.debug(res.inspect)
849852
return res
850853
end
851854

@@ -1704,7 +1707,7 @@ def update(values,table=@table)
17041707
begin
17051708
dbh.execute(query, value, id)
17061709
rescue Exception => e
1707-
IOLIBLOGGER.error("Error in query `#{query}` with field `#{value}` for id `#{id}`")
1710+
IOLIBLOGGER.error("Error in query `#{query}` with field `#{value}` for id `#{id}`: #{e}")
17081711
raise
17091712
end
17101713
end

0 commit comments

Comments
 (0)