18F / imls-pi-stack

Other
7 stars 0 forks source link

Session id tracking is redundant state #2

Open cantsin opened 3 years ago

cantsin commented 3 years ago

(Imported from https://github.com/cantsin/imls-pi-stack/issues/10)

Instead of a counter in the DB, it might be better to just ask what DISTINCT session IDs are in the durations table (at startup), and then increment by one.

If we do this every time we startup, and simply track the session ID in RAM as we execute, we'll always have a correct session ID, and we can eliminate a piece of state.

(I think. That bears more thinking/discussion. But I wouldn't mind removing an explicit piece of state when it already exists somewhere else, and the possibility of it getting out-of-sync is real.)