Skip to content

Propagate db through handlers

Administrator requested to merge cc/propagate-db-newcommon into main

Created by: camdencheek

This propagates a database handle through our http handlers. This has been the biggest blocker to me getting rid of global db handles entirely, since the remaining places we use dbconn.Global are largely direct descendents of these handlers. I've been putting this change off because it's very messy, and requires passing a db directly through a bunch of functions, but I think this is the only way to move forward here, so I'm ripping off the band-aid. There are a lot of circular references in our handlers which makes it impossible to isolate this change cleanly without just doing it all at once. I'm keeping this PR focused on the db propagation, but our handlers could use a bit of clean up to untangle them. This might also make it unnecessary to pass a db through quite so many functions.

I would recommend viewing without whitespace changes, because there are a few big indentation changes.

Anyways, this gets rid of one more instance of dbconn.Global, and will enable getting rid of many more.

1 down, 37 to go.

Merge request reports

Loading