From 062be6d544a49fa57c9204b9475a3a762c50f3d7 Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Wed, 28 Aug 2019 11:22:35 +0100 Subject: [PATCH] output_processors/postgresql: Don't reconnect if not initialised Update check to clarify that we should not attempt to reconnect to the database if the initialisation of the output processor failed. --- wa/output_processors/postgresql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wa/output_processors/postgresql.py b/wa/output_processors/postgresql.py index 79efaa2a..ab48ea87 100644 --- a/wa/output_processors/postgresql.py +++ b/wa/output_processors/postgresql.py @@ -305,7 +305,7 @@ class PostgresqlResultProcessor(OutputProcessor): ''' A final export of the RunOutput that updates existing parameters and uploads ones which are only generated after jobs have run. ''' - if not self.cursor: # Database did not connect correctly. + if self.cursor is None: # Output processor did not initialise correctly. return # Ensure we're still connected to the database. self.connect_to_database()