MCPcopy Index your code
hub / github.com/webpy/webpy / cleanup

Method cleanup

web/session.py:302–314  ·  view source on GitHub ↗
(self, timeout)

Source from the content-addressed store, hash-verified

300 os.remove(path)
301
302 def cleanup(self, timeout):
303 if not os.path.isdir(self.root):
304 return
305
306 now = time.time()
307 for f in os.listdir(self.root):
308 path = self._get_path(f)
309 atime = os.stat(path).st_atime
310 if now - atime > timeout:
311 if os.path.isdir(path):
312 shutil.rmtree(path)
313 else:
314 os.remove(path)
315
316
317class DBStore(Store):

Callers 1

testRemovedSessionDirMethod · 0.95

Calls 1

_get_pathMethod · 0.95

Tested by 1

testRemovedSessionDirMethod · 0.76