From 61298051941300aa8714aa921bfa3935a3e56fb9 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Wed, 11 Sep 2013 14:59:47 -0500 Subject: [PATCH] removed dbsession2trash.py since functionality duplicated in session2trash.py --- VERSION | 2 +- scripts/dbsessions2trash.py | 25 ------------------------- 2 files changed, 1 insertion(+), 26 deletions(-) delete mode 100644 scripts/dbsessions2trash.py diff --git a/VERSION b/VERSION index 6c47ee98..fabc0005 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.6.0-development+timestamp.2013.09.11.12.13.20 +Version 2.6.0-development+timestamp.2013.09.11.14.58.55 diff --git a/scripts/dbsessions2trash.py b/scripts/dbsessions2trash.py deleted file mode 100644 index a8ccd69d..00000000 --- a/scripts/dbsessions2trash.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from datetime import datetime -from time import mktime -from time import sleep -from time import time - -DB_URI = 'sqlite://sessions.sqlite' -EXPIRATION_MINUTES = 60 -SLEEP_MINUTES = 5 - -while 1: # Infinite loop - now = time() # get current Unix timestamp - - for row in db().select(db.web2py_session_welcome.ALL): - t = row.modified_datetime - # Convert to a Unix timestamp - t = mktime(t.timetuple()) + 1e-6 * t.microsecond - if now - t > EXPIRATION_MINUTES * 60: - del db.web2py_session_welcome[row.id] - - db.commit() # Write changes to database - - sleep(SLEEP_MINUTES * 60)