Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Ticket #760 (defect)

Opened 9 months ago

Last modified 8 months ago

Session tool cleanup frequency

Status: closed (fixed)

Reported by: dag@brattli.net Assigned to: rdelon
Priority: normal Milestone: 3.1
Component: CherryPy code Keywords:
Cc:

The session tool cleanup frequency is to high. The documentation specifies that it shoud be given in minutes, but session.load() calls PerpetualTimer (CherryPy 3.0.2) and cherrypy.restsrv.plugins.Monitor (CherryPy 3.1b1) without scaling the value

PerpetualTimer is a subclass of threading.Timer which has the following documentation:

class Timer(interval, function, args=[], kwargs={})

Create a timer that will run function with arguments args and
keyword arguments kwargs, after interval seconds have passed.

Monitor in CherryPy 3.1b1 states itself that the timeout is in seconds.

Thus the default value of clean_freq=5 will call cleanup every 5 seconds instead of every 5 minutes. The correct code for CherryPy 3.0.2 should be:

t = PerpetualTimer(self.clean_freq*60, self.clean_up)

And CherryPy 3.1b1:

t = cherrypy.restsrv.plugins.Monitor(
                cherrypy.engine, self.clean_up, self.clean_freq*60)

One other option is to change documentation to say that the cleanup frequency is in seconds instead of minutes, giving developers the option of specifying a cleanup frequency lower than 1 minute.

-- Dag

Change History

01/12/08 17:44:22: Modified by fumanchu

  • status changed from new to closed.
  • resolution set to fixed.
  • description changed.

Darn tootin'. Fixed in both versions in [1838].

Hosted by WebFaction

Log in as guest/cpguest to create tickets