Land #10638, Warn when listing inactive sessions without DB connection
Replaces confusing message and stack trace with a warning message, when the `sessions -d` command is used to list inactive sessions when no database is connected.4.x
parent
3ff9b3b0c9
commit
057228c60b
|
@ -612,10 +612,12 @@ class ReadableText
|
|||
'Indent' => indent,
|
||||
'SortIndex' => 1)
|
||||
|
||||
framework.db.sessions.each do |session|
|
||||
unless session.closed_at.nil?
|
||||
row = create_mdm_session_row(session, show_extended)
|
||||
tbl << row
|
||||
if framework.db.active
|
||||
framework.db.sessions.each do |session|
|
||||
unless session.closed_at.nil?
|
||||
row = create_mdm_session_row(session, show_extended)
|
||||
tbl << row
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1205,6 +1205,10 @@ class Core
|
|||
end
|
||||
end
|
||||
|
||||
if show_inactive && !framework.db.active
|
||||
print_warning("Database not connected; list of inactive sessions unavailable")
|
||||
end
|
||||
|
||||
last_known_timeout = nil
|
||||
|
||||
# Now, perform the actual method
|
||||
|
|
Loading…
Reference in New Issue