Klaas van Schelven edff0e219c PeriodCounter: remove event-based approach
Replacing it with passing the thresholds on each call to `inc`.

The event-based approach was broken in a multi-process setup (such as having a separate
gunicorn and snappea), because the unmute events would be registered GUI-side
(gunicorn), and the single process where the counting happened had a different PC
instance.

The solution is to get rid of the event-listener approach, and just make an inventory of
the threshold-checks that need to be done right before each call to `inc`. Because the
calls to `inc` happen in a single process (we [will] enforce this elsewhere) this fixes
the problem.

During refactoring it became clear that this is probably a good idea anyway: many
comments about corner-cases could be removed.

Other things I found:

* The now-removed `_digest_event_python_postprocessing` did more than Python alone (it
  also touched the DB for unmutes) so that was probably a separate bug (now fixed).

* In the event-listener-based code, I foresaw the need for `on_become_false` (but did
  not use it yet). The idea was probably that this could be useful in the quota setting
  (a quota can become unmet after a while) but in fact it isn't useful, because when a
  quota becomes unmet you'd still need to check all quota and OR them.

Tests have not been truly refactored (the new architecture probably points to a new
desired set of tests) but rather have been made to run in the simplest way possible.
2024-07-09 09:31:36 +02:00
2024-06-13 13:23:14 +02:00
2024-03-30 11:56:29 +01:00
2024-06-17 11:08:29 +02:00
2024-06-14 12:51:31 +02:00
2024-06-14 10:29:10 +02:00
2024-05-16 10:31:59 +02:00
2024-05-27 13:54:01 +02:00
2024-01-04 20:37:26 +01:00
2023-10-29 16:43:39 +01:00
2024-06-03 22:30:10 +02:00
2024-05-15 13:32:11 +02:00
2024-05-27 13:54:02 +02:00
2024-03-20 17:37:27 +01:00
S
Description
Self-hosted Error Tracking
Readme 29 MiB
Languages
Python 82.2%
HTML 16%
CSS 0.8%
JavaScript 0.6%
Shell 0.3%