Age | Commit message (Collapse) | Author |
|
- allow different log format when logging verbosely
- don't assign to self.log during __init__, instead use class var
This allows subclass var to override self.log
|
|
extract code from .print_ini and make usable elsewhere too.
|
|
use_skylog logging was already doing it. Now that simple
logging does it do, using self.log is not mandatory anymore,
code can use 'logging' module directly.
Also make console and logfile output configurable.
|
|
Mainly for simple way to set db mode across all get_database() calls.
|
|
|
|
stat_add -> stat_put
stat_inc -> stat_increase
|
|
|
|
|
|
.reload() happens between .work() calls, so it's safe to
drop connection on first .get_database()
|
|
|
|
Always use
import skytools
def xx():
skytools.foo
this allows maximum laziness when importing.
|
|
|
|
|
|
|
|
|
|
|
|
This avoids console commands to send errors/warnings to central logging server.
Set use_skylog=2 to always enable.
|
|
Use DBScript .listen(dbname, chan)/.unlisten(dbname, chan) to register.
|
|
|
|
This allows config-less scripts to override it.
|
|
Precalculating 'prefer_looping' does not work as the parameters
may be changed inside called function.
|
|
This will allow smarter handling of sleep time in the future.
Eg. wake up on notice from db.
|
|
|
|
loop_delay is loaded from conf, so it conflicts with .set_single_loop()
in scripts which have both looping mode and non-looping mode.
Eg: londiste, walmgr
|
|
|
|
|
|
Based on patch by Hannu Krosing
|
|
- signal_pidfile: Clarify ValueError error message. Thrown usually
on empty pidfiles, the error messega will now mention the pidfile name.
- run_single_process: restructure pidfile writing, so that
the pidfile is removed if .write() failed, but not when open() failed.
This should avoid the chance that empty pidfiles are hanging around.
|
|
|
|
- looping: remove .do_single_loop and .looping variables, let only .loop_delay
control looping. If loop_delay is missing from confing or 0, then
instead sleep, the script will exit.
- docstr: print docstring fragments recursively, so each class
needs to only document its own parameters.
- londiste.py: use Replicator class to print default config as it has
proper class inheritance.
|
|
|
|
If exception was thrown, set work_state = -1, to let consumer
handle next work differently.
|
|
* Template config is now in docstring to make to more
easy to keep up-to-date.
* dbscript: --ini option to show template config.
|
|
|
|
|
|
also remove pointless job_name default, as it is already
handled in Config class.
|
|
Have single place where exceptions are handled.
psycopg attaches .cursor to each exception,
use that to show connection name in error messages.
|
|
- bring londiste help message more up to date
- add --help hint for DBScript start error msg
- bump pgq version to 3.0devel
|
|
When thrown, the DBScript will just print the error message,
without traceback and any additional noise
To be used to show user simple error messages.
Can be used to build own Exception classes.
|
|
- docstrings
- some preliminary python 3.0 compat (var names, print())
- sync with 2.1-stable
adminscript:
- move exec_cmd function to dbscript
dbstruct:
- support sequnces. SERIAL columns are not automatically created,
but the link beteween column and sequence is.
psycopgwrapper:
- drop support for psycopg1
- beginnings of quick DB-API / DictRow description.
quoting:
- new unquote_fqident() function, reverse of quote_fqident()
- quote_statement() accepts both row and dict
dbscript:
- catch startup errors
- use log.exception for exceptions, will result in nicer logs
sqltools:
- exists_sequence()
_pyquoting:
- fix typo in variable name
|
|
|
|
|
|
|
|
|
|
simple init/event processing/copy seems to work.
|
|
|
|
|
|
|
|
|
|
|