Commit graph

19 commits

Author SHA1 Message Date
a101ff3cc9
Suppress errors from canceled context on DB notification goroutine 2026-04-28 22:24:15 +00:00
0b005c3e76
Add debug logs around exiting goroutines
I'm debugging our clean shutdown
2026-04-21 19:37:58 +00:00
bcea3c6bdf
Gracefully exit listenForJobs when context ends 2026-04-21 14:59:52 +00:00
ade629ecf5
Rework background jobs to make transactions much shorter
I ended up with minutes-long open transactions in the database in prod
which was causing outtages. This is because I thought transactions were
basically free, which is a terrible thing to think. Instead we'll just
open them when we need them.
2026-04-17 22:53:23 +00:00
a6ca30fdb1
Add application name to transaction
Trying to find what's getting locked
2026-04-17 21:27:30 +00:00
abbe80b1f0
Don't fail to process background jobs because one failed 2026-04-17 20:51:24 +00:00
0e777568fb
Add sublogging for job work for debugging 2026-04-17 20:25:25 +00:00
21587493c0
Stop swamping the server on reboot 2026-04-17 18:36:05 +00:00
fd662721bb
Fix non-rolled-back transactions 2026-04-17 18:19:13 +00:00
4a8c0d2e60
defer rollback rather than guard returns
I'm trying to make sure we close transactions on the database
2026-04-17 18:00:26 +00:00
81e057b900
Add initial work for backgrounding mailer job 2026-04-16 17:15:20 +00:00
cb34c43ef4
Improve error messages on notify failures 2026-03-19 21:29:55 +00:00
fdab54a775
Fix saving note images and transcoding 2026-03-19 20:49:17 +00:00
6338d9f3f3
Remove chatty debug log 2026-03-19 03:52:40 +00:00
45643e8369
fix redundant log message 2026-03-19 03:52:28 +00:00
15766d0f86
Fix build for staging 2026-03-18 19:59:42 +00:00
685b7456b6
Return logs on comms public reports
...and start to display them. A bit.
2026-03-18 18:56:51 +00:00
1e071d5ce5
Overhaul publicreport storage layer, create unified tables
This is a huge change. I was getting really sick of the split between
nuisance/water tables when more than half of the data they store is
common. I finally bit off the big work of switching it all.

This creates a single unified table, publicreport.report and copies the
existing report data into it. It also ports existing data from the
original tables into the new table.

Along with all of this I also overhauled the system for handling
asynchronous work to use a LISTEN/NOTIFY connection from the database
and a single cache table to avoid ever losing work.
2026-03-18 15:36:20 +00:00
2538638c9d
Create generic backend process, fix background interdependencies
This refactor was born out of the inter-dependency cycles developing
between the "background" module and just about every other module which
was caused by the background module becoming a dependency of every
module that needed to background work and the fact that the background
module was also supposedly responsible for the logic for processing
those tasks.

Instead the "background" module is now very, very shallow and relies
entirely on the Postgres NOTIFY logic for triggering jobs. There's a new
table, `job` which holds just a type and single row ID.

All told, this means that jobs can be added to the queue as part of the
API-level or platform-level transaction, ensuring atomicity, and
processing coordination is handled by the platform module, which can
depend on anything.
2026-03-16 19:52:29 +00:00