about summary refs log tree commit diff
path: root/web/panettone/src/packages.lisp
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-02-02T23·18+0300
committerclbot <clbot@tvl.fyi>2022-02-13T17·20+0000
commitfe290a5ff8033b1b606ac80131ec2e5b0b30f0e4 (patch)
treea16571f52c072dcf1a32414ac97151e7f36e09a9 /web/panettone/src/packages.lisp
parentb7be2660c92fe206e01c0236dc03e2dee03dfa3b (diff)
refactor(web/panettone): Use postmodern connection pools r/3814
Instead of managing Postgres connections on our own, use the
`with-connection` postmodern function with pooling enabled as a route
decorator.

This should resolve at least some of the issues from b/113 with
leaking connections, and an unreported issue with connections being
reused while transactions are in progress.

Change-Id: I1ed68667a3240900de1ae69df37d2d3018caf204
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5198
Tested-by: BuildkiteCI
Reviewed-by: eta <tvl@eta.st>
Autosubmit: tazjin <tazjin@tvl.su>
Diffstat (limited to 'web/panettone/src/packages.lisp')
-rw-r--r--web/panettone/src/packages.lisp6
1 files changed, 4 insertions, 2 deletions
diff --git a/web/panettone/src/packages.lisp b/web/panettone/src/packages.lisp
index b0833e454135..81d2bed728d4 100644
--- a/web/panettone/src/packages.lisp
+++ b/web/panettone/src/packages.lisp
@@ -32,7 +32,9 @@
   (:use :cl :panettone.util :klatre :postmodern :iterate)
   (:import-from :alexandria :if-let :when-let :define-constant)
   (:export
-   :connect-postgres :ddl/init :make-thread
+   :prepare-db-connections
+   :ddl/init
+   :*pg-spec*
 
    :user-settings
    :user-dn :enable-email-notifications-p :settings-for-user
@@ -76,7 +78,7 @@
    :panettone.model
    :id :subject :body :author-dn :issue-id :status :created-at
    :field :previous-value :new-value :acting-user-dn
-   :issue-comments :num-comments :issue-events)
+   :*pg-spec*)
   (:import-from :panettone.irc :send-irc-notification)
   (:shadow :next)
   (:export :start-pannetone :config :main))