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.)
(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 thedurations
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.)