Package pgq :: Module maint :: Class MaintenanceJob
[frames] | no frames]

Class MaintenanceJob

source code

                 object --+    
                          |    
skytools.scripting.DBScript --+
                              |
                             MaintenanceJob

Periodic maintenance.

Instance Methods
 
__init__(self, ticker, args)
Script setup.
source code
 
startup(self)
Will be called just before entering main loop.
source code
 
reload(self)
Reload config.
source code
 
work(self)
Here should user's processing happen.
source code
 
do_maintenance(self)
Helper function for running maintenance.
source code

Inherited from skytools.scripting.DBScript: close_database, get_database, hook_sighup, hook_sigint, init_optparse, reset, run, run_once, send_signal, send_stats, set_single_loop, start, stat_add, stat_increase, stat_put, stop

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables

Inherited from skytools.scripting.DBScript: cf, job_name, log, service_name

Properties

Inherited from object: __class__

Method Details

__init__(self, ticker, args)
(Constructor)

source code 

Script setup.

User class should override work() and optionally __init__(), startup(), reload(), reset() and init_optparse().

NB: in case of daemon, the __init__() and startup()/work() will be run in different processes. So nothing fancy should be done in __init__().
Overrides: skytools.scripting.DBScript.__init__
(inherited documentation)

startup(self)

source code 

Will be called just before entering main loop.

In case of daemon, if will be called in same process as work(), unlike __init__().
Overrides: skytools.scripting.DBScript.startup
(inherited documentation)

reload(self)

source code 
Reload config.
Overrides: skytools.scripting.DBScript.reload
(inherited documentation)

work(self)

source code 
Here should user's processing happen.
Overrides: skytools.scripting.DBScript.work
(inherited documentation)