Skip to content

Commit fc21da1

Browse files
committed
PB-1785: upgrade to psycopg 3.
Before this change we were using psycopg 2.9.10. This does not seem to be designed to [work correctly with gevent](https://www.psycopg.org/docs/advanced.html#support-for-coroutine-libraries) "out of the box". The [psycogreen](https://github.com/psycopg/psycogreen/) library was written to resolve that problem but we don't seem to be using it at all. Upgrading to [psycopg 3 allows proper integration with gevent](https://www.psycopg.org/psycopg3/docs/advanced/async.html#gevent-support) without psycogreen or other workaround. This change upgrades service-stac from psycopg 2.9.10 to 3.2.9. This was done by updating the Pipfile then running `pipenv install`. This also updated other dependencies. In local tests, I verified the `/checker` endpoint remains much more responsive with this change when end-to-end tests are being run. Maximum measured latency dropped from ~15 seconds to ~3 seconds.
1 parent c423d39 commit fc21da1

File tree

2 files changed

+395
-346
lines changed

2 files changed

+395
-346
lines changed

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pytest-xdist = "*"
2828
[packages]
2929
gevent = "~=25.5"
3030
gunicorn = "~=23.0"
31-
psycopg2-binary = "~=2.9"
31+
psycopg = {extras = ["binary"], version = "~=3.2"}
3232
numpy = "~=2.3"
3333
python-dotenv = "~=1.1"
3434
djangorestframework = "~=3.16"

0 commit comments

Comments
 (0)