Fixed dashboard server activity issue when active_since parameter is None. Fixes #6650

This commit is contained in:
Akshay Joshi 2021-07-29 11:49:27 +05:30
parent 2dd88e5a4e
commit 03477d407e
2 changed files with 10 additions and 9 deletions

View File

@ -26,3 +26,4 @@ Bug fixes
| `Issue #6586 <https://redmine.postgresql.org/issues/6586>`_ - Fixed incorrect tablespace options in the drop-down for move objects dialog.
| `Issue #6619 <https://redmine.postgresql.org/issues/6619>`_ - Fixed incorrect binary path issue when the user deletes the binary path from the preferences.
| `Issue #6643 <https://redmine.postgresql.org/issues/6643>`_ - Ensure that all the required options should be loaded when the Range data type is selected while creating a custom data type.
| `Issue #6650 <https://redmine.postgresql.org/issues/6650>`_ - Fixed dashboard server activity issue when active_since parameter is None.

View File

@ -365,15 +365,15 @@ def get_long_running_query_status(activities):
for row in activities:
row['row_type'] = None
# We care for only those queries which are in active state.
if row['state'] != 'active':
continue
active_since = float(row['active_since'])
if active_since > warning_value:
row['row_type'] = 'warning'
if active_since > alert_value:
row['row_type'] = 'alert'
# We care for only those queries which are in active state and
# have active_since parameter and not None
if row['state'] == 'active' and 'active_since' in row and \
row['active_since'] is not None:
active_since = float(row['active_since'])
if active_since > warning_value:
row['row_type'] = 'warning'
if active_since > alert_value:
row['row_type'] = 'alert'
@blueprint.route('/dashboard_stats',