Mercurial > p > roundup > code
changeset 8406:e7f8b0e1dda1
merge doc fix and perf fix/warning to session_dbm.py:clean()
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 10 Aug 2025 20:35:53 -0400 |
| parents | be227ab4c2e1 (current diff) 5eb470cbcc08 (diff) |
| children | 700424ba015c |
| files | |
| diffstat | 2 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/customizing.txt Sun Aug 10 20:31:16 2025 -0400 +++ b/doc/customizing.txt Sun Aug 10 20:35:53 2025 -0400 @@ -1892,7 +1892,7 @@ and at the bottom of that table add:: </table> - </form + </form> making sure you match the ``</table>`` from the list table, not the navigation table or the subsequent form table.
--- a/roundup/backends/sessions_dbm.py Sun Aug 10 20:31:16 2025 -0400 +++ b/roundup/backends/sessions_dbm.py Sun Aug 10 20:35:53 2025 -0400 @@ -203,15 +203,18 @@ ''' Remove session records that haven't been used for a week. ''' now = time.time() week = 60*60*24*7 + a_week_ago = now - week for sessid in self.list(): sess = self.get(sessid, '__timestamp', None) if sess is None: self.updateTimestamp(sessid) continue - interval = now - sess - if interval > week: + if a_week_ago > sess: self.destroy(sessid) + run_time = time.time() - now + if run_time > 3: + self.log_warning("clean() took %.2fs", run_time) class Sessions(BasicDatabase): name = 'sessions'
