Skip to content

Commit

Permalink
Merge pull request #13 from semiotic-ai/custom-pg-ports
Browse files Browse the repository at this point in the history
Added custom ports for postgres
  • Loading branch information
aasseman committed May 3, 2023
2 parents 7891999 + 4a62d51 commit 9b47dcd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
8 changes: 8 additions & 0 deletions autoagora_processor/db_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@
required=True,
help="Password for the graph-node database.",
)
argsparser.add_argument(
"--graph-postgres-port ",
env_var="GRAPH_POSTGRES_PORT",
default=5432,
required=True,
help="Port for the graph-node database.",
)


def get_indexed_subgraphs() -> Set[str]:
Expand All @@ -42,6 +49,7 @@ def get_indexed_subgraphs() -> Set[str]:
user=args.graph_postgres_username,
password=args.graph_postgres_password,
host=args.graph_postgres_host,
port=args.graph_postgres_port,
)
cur = conn.cursor()

Expand Down
5 changes: 4 additions & 1 deletion autoagora_processor/logs_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ def __init__(
user: str,
password: str,
host: str,
port: str,
) -> None:
self.conn = pg.connect(dbname=dbname, user=user, password=password, host=host)
self.conn = pg.connect(
dbname=dbname, user=user, password=password, host=host, port=port
)
self.conn.autocommit = True
self.cur = self.conn.cursor()

Expand Down
8 changes: 8 additions & 0 deletions autoagora_processor/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@
required=True,
help="Password for the logs database.",
)
argsparser.add_argument(
"--postgres-port",
env_var="POSTGRES_PORT",
default=5432,
required=True,
help="Port for the logs database.",
)
argsparser.add_argument(
"--log-level",
env_var="LOG_LEVEL",
Expand All @@ -121,6 +128,7 @@
user=args.postgres_username,
password=args.postgres_password,
host=args.postgres_host,
port=args.postgress_port,
)

subgraph_schemas = SubgraphSchemas()
Expand Down

0 comments on commit 9b47dcd

Please sign in to comment.