1
0
Fork 0

use same db for all tables

This commit is contained in:
Mikhail Goncharov 2021-06-18 12:21:41 +02:00
parent 8e156990fc
commit d11188e407
3 changed files with 3 additions and 3 deletions

View file

@ -18,7 +18,7 @@ metadata:
name: linux-agents-test
namespace: buildkite
spec:
replicas: 0
replicas: 1
strategy:
rollingUpdate:
maxSurge: 25%

View file

@ -21,7 +21,7 @@ BUILDBOT_URL = "https://lab.llvm.org/buildbot/api/v2/"
def connect_to_db() -> psycopg2.extensions.connection:
"""Connect to the database."""
conn = psycopg2.connect(
f"host=127.0.0.1 sslmode=disable dbname=buildbots user=stats password={os.getenv('DB_PASSWORD')}")
f"host=127.0.0.1 sslmode=disable dbname=stats user=stats password={os.getenv('DB_PASSWORD')}")
return conn

View file

@ -59,7 +59,7 @@ def log_server_status(phab: bool, buildbot: bool, conn: psycopg2.extensions.conn
def connect_to_db() -> psycopg2.extensions.connection:
"""Connect to the database, create tables as needed."""
conn = psycopg2.connect(
f"host=127.0.0.1 sslmode=disable dbname=phabricator user=stats password={os.getenv('DB_PASSWORD')}")
f"host=127.0.0.1 sslmode=disable dbname=stats user=stats password={os.getenv('DB_PASSWORD')}")
cur = conn.cursor()
cur.execute(
"CREATE TABLE IF NOT EXISTS server_status (timestamp timestamp, phabricator boolean, buildbot boolean);"