Check DB is active before querying sessions
parent
fe7a832aa8
commit
6a6d92abc1
|
@ -620,12 +620,14 @@ class ReadableText
|
||||||
'Indent' => indent,
|
'Indent' => indent,
|
||||||
'SortIndex' => 1)
|
'SortIndex' => 1)
|
||||||
|
|
||||||
|
if framework.db.active
|
||||||
framework.db.sessions.each do |session|
|
framework.db.sessions.each do |session|
|
||||||
unless session.closed_at.nil?
|
unless session.closed_at.nil?
|
||||||
row = create_mdm_session_row(session, show_extended)
|
row = create_mdm_session_row(session, show_extended)
|
||||||
tbl << row
|
tbl << row
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
output << (tbl.rows.count > 0 ? tbl.to_s : "#{tbl.header_to_s}No inactive sessions.\n")
|
output << (tbl.rows.count > 0 ? tbl.to_s : "#{tbl.header_to_s}No inactive sessions.\n")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue