Skip to content

Commit

Permalink
Merge pull request #117 from openstates/db-set-application-name/OS-1432
Browse files Browse the repository at this point in the history
DB settings: set application_name for better performance monitoring
  • Loading branch information
NewAgeAirbender authored Oct 16, 2023
2 parents 7079773 + a1df835 commit f513ebc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 6.17.8 - October 16, 2023

* set application_name for better performance monitoring

## 6.17.5 - August 9, 2023

* Add new bill statuses to validation
Expand Down
5 changes: 5 additions & 0 deletions openstates/utils/django.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ def init_django() -> None: # pragma: no cover
"DATABASE_URL", "postgis://openstates:openstates@localhost/openstates"
)
DATABASES = {"default": dj_database_url.parse(DATABASE_URL)}
application_name = "os_core"
if "OPTIONS" not in DATABASES:
DATABASES["default"]["OPTIONS"] = {"application_name": application_name}
else:
DATABASES["default"]["OPTIONS"]["application_name"] = application_name

conf.settings.configure(
conf.global_settings,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "openstates"
version = "6.17.7"
version = "6.17.8"
description = "core infrastructure for the openstates project"
authors = ["James Turk <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit f513ebc

Please sign in to comment.