diff options
author | Richard van der Hoff <richard@matrix.org> | 2018-04-06 13:45:10 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2018-04-06 15:33:30 +0100 |
commit | e01ba5bda315ed80f2a809e2f2e917eaf7488fac (patch) | |
tree | bf263df558b1885c5178db56da01e6440dc107ce /scripts/synapse_port_db | |
parent | more verbosity in synctl (diff) | |
download | synapse-e01ba5bda315ed80f2a809e2f2e917eaf7488fac.tar.xz |
Port script: avoid nasty errors when setting up
We really shouldn't spit out "Failed to create port table", it looks scary.
Diffstat (limited to 'scripts/synapse_port_db')
-rwxr-xr-x | scripts/synapse_port_db | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/scripts/synapse_port_db b/scripts/synapse_port_db index d46581e4e1..7fb8be3abd 100755 --- a/scripts/synapse_port_db +++ b/scripts/synapse_port_db @@ -1,6 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2015, 2016 OpenMarket Ltd +# Copyright 2018 New Vector Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -491,7 +492,7 @@ class Porter(object): def create_port_table(txn): txn.execute( - "CREATE TABLE port_from_sqlite3 (" + "CREATE TABLE IF NOT EXISTS port_from_sqlite3 (" " table_name varchar(100) NOT NULL UNIQUE," " forward_rowid bigint NOT NULL," " backward_rowid bigint NOT NULL" @@ -517,14 +518,11 @@ class Porter(object): "alter_table", alter_table ) except Exception as e: - logger.info("Failed to create port table: %s", e) + pass - try: - yield self.postgres_store.runInteraction( - "create_port_table", create_port_table - ) - except Exception as e: - logger.info("Failed to create port table: %s", e) + yield self.postgres_store.runInteraction( + "create_port_table", create_port_table + ) self.progress.set_state("Setting up") |