Skip to content
Snippets Groups Projects
Commit 85c2c75a authored by Eric Frias's avatar Eric Frias
Browse files

Add an application_name parameter to our postgres connection string to

make it easier to see what app is doing what in pgAdmin & friends
parent 0ae830ca
No related branches found
No related tags found
2 merge requests!83Merge develop to master for release,!54Add an application_name parameter to our postgres connection string to
Pipeline #109309 passed
......@@ -34,6 +34,7 @@ IS_FORKING=${IS_FORKING:-"true"}
SWAGGER_URL=${SWAGGER_URL:-"{reptracker-host}"}
CREATE_SCHEMA=1
CREATE_INDEXES=1
POSTGRES_APP_NAME=reptracker_install
while [ $# -gt 0 ]; do
......@@ -58,9 +59,11 @@ while [ $# -gt 0 ]; do
;;
--indexes-only)
CREATE_SCHEMA=0
POSTGRES_APP_NAME=reptracker_install_indexes
;;
--schema-only)
CREATE_INDEXES=0
POSTGRES_APP_NAME=reptracker_install_schema
;;
--help)
print_help
......@@ -82,7 +85,7 @@ while [ $# -gt 0 ]; do
shift
done
POSTGRES_ACCESS=${POSTGRES_URL:-"postgresql://$POSTGRES_USER@$POSTGRES_HOST:$POSTGRES_PORT/haf_block_log"}
POSTGRES_ACCESS=${POSTGRES_URL:-"postgresql://$POSTGRES_USER@$POSTGRES_HOST:$POSTGRES_PORT/haf_block_log?application_name=${POSTGRES_APP_NAME}"}
create_haf_indexes() {
if [ "$(psql "$POSTGRES_ACCESS" --quiet --no-align --tuples-only --command="SELECT ${REPTRACKER_SCHEMA}.do_rep_indexes_exist();")" = f ]; then
......
......@@ -63,7 +63,7 @@ while [ $# -gt 0 ]; do
shift
done
POSTGRES_ACCESS=${POSTGRES_URL:-"postgresql://$POSTGRES_USER@$POSTGRES_HOST:$POSTGRES_PORT/haf_block_log"}
POSTGRES_ACCESS=${POSTGRES_URL:-"postgresql://$POSTGRES_USER@$POSTGRES_HOST:$POSTGRES_PORT/haf_block_log?application_name=reptracker_block_processing"}
process_blocks() {
local n_blocks="${1:-null}"
......
......@@ -65,7 +65,7 @@ while [ $# -gt 0 ]; do
shift
done
POSTGRES_ACCESS=${POSTGRES_URL:-"postgresql://$POSTGRES_USER@$POSTGRES_HOST:$POSTGRES_PORT/haf_block_log"}
POSTGRES_ACCESS=${POSTGRES_URL:-"postgresql://$POSTGRES_USER@$POSTGRES_HOST:$POSTGRES_PORT/haf_block_log?application_name=reptracker_uninstall"}
uninstall_app() {
remove_context_sql=$(cat << EOF
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment