use same db for all tables
This commit is contained in:
parent
8e156990fc
commit
d11188e407
3 changed files with 3 additions and 3 deletions
|
@ -18,7 +18,7 @@ metadata:
|
||||||
name: linux-agents-test
|
name: linux-agents-test
|
||||||
namespace: buildkite
|
namespace: buildkite
|
||||||
spec:
|
spec:
|
||||||
replicas: 0
|
replicas: 1
|
||||||
strategy:
|
strategy:
|
||||||
rollingUpdate:
|
rollingUpdate:
|
||||||
maxSurge: 25%
|
maxSurge: 25%
|
||||||
|
|
|
@ -21,7 +21,7 @@ BUILDBOT_URL = "https://lab.llvm.org/buildbot/api/v2/"
|
||||||
def connect_to_db() -> psycopg2.extensions.connection:
|
def connect_to_db() -> psycopg2.extensions.connection:
|
||||||
"""Connect to the database."""
|
"""Connect to the database."""
|
||||||
conn = psycopg2.connect(
|
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
|
return conn
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ def log_server_status(phab: bool, buildbot: bool, conn: psycopg2.extensions.conn
|
||||||
def connect_to_db() -> psycopg2.extensions.connection:
|
def connect_to_db() -> psycopg2.extensions.connection:
|
||||||
"""Connect to the database, create tables as needed."""
|
"""Connect to the database, create tables as needed."""
|
||||||
conn = psycopg2.connect(
|
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 = conn.cursor()
|
||||||
cur.execute(
|
cur.execute(
|
||||||
"CREATE TABLE IF NOT EXISTS server_status (timestamp timestamp, phabricator boolean, buildbot boolean);"
|
"CREATE TABLE IF NOT EXISTS server_status (timestamp timestamp, phabricator boolean, buildbot boolean);"
|
||||||
|
|
Loading…
Reference in a new issue