Merge pull request #1166 from Rimbo/overblown-sessions-cleanup
Make SessionSetDb.get() a generator.
This commit is contained in:
@@ -104,12 +104,10 @@ class SessionSetDb(SessionSet):
|
|||||||
|
|
||||||
def get(self):
|
def get(self):
|
||||||
"""Return list of SessionDb instances for existing sessions."""
|
"""Return list of SessionDb instances for existing sessions."""
|
||||||
sessions = []
|
|
||||||
table = current.response.session_db_table
|
table = current.response.session_db_table
|
||||||
if table:
|
if table:
|
||||||
for row in table._db(table.id > 0).select():
|
for row in table._db(table.id > 0).select():
|
||||||
sessions.append(SessionDb(row))
|
yield SessionDb(row)
|
||||||
return sessions
|
|
||||||
|
|
||||||
|
|
||||||
class SessionSetFiles(SessionSet):
|
class SessionSetFiles(SessionSet):
|
||||||
|
|||||||
Reference in New Issue
Block a user