Changeset - df5a67678b96
default
0
3
0
celeryd: let the gearbox command use db session as most other gearbox commands do
304aae43194c changed the common gearbox wrapper so make_app_without_logging
only was run for commands tagged as requires_db_session. That broke celeryd -
even a plain 'gearbox celeryd -c my.ini' would fail on the safety check in
celerypylons asserting on tg.config having 'celery.imports' configuration.
The gearbox celeryd command did not really require a db session - it just
required app configuration so it could create db sessions on the fly.
To to get the missing make_app_without_logging invocation back, set
requires_db_session (the default for our gearbox commands).
requires_db_session not only calls make_app_without_logging (which undo the
effect from 304aae43194c), it also calls setup_cache_regions,
engine_from_config, and init_model. These were also invoked explicitly in
celeryd code - these double invocations are dropped too.
Also, make_app_without_logging will call into tg and thus invoke the
setup_configuration hook which will set kallithea.CELERY_ON and call
load_rcextensions. The celeryd code for doing that is thus dropped.
304aae43194c changed the common gearbox wrapper so make_app_without_logging
only was run for commands tagged as requires_db_session. That broke celeryd -
even a plain 'gearbox celeryd -c my.ini' would fail on the safety check in
celerypylons asserting on tg.config having 'celery.imports' configuration.
The gearbox celeryd command did not really require a db session - it just
required app configuration so it could create db sessions on the fly.
To to get the missing make_app_without_logging invocation back, set
requires_db_session (the default for our gearbox commands).
requires_db_session not only calls make_app_without_logging (which undo the
effect from 304aae43194c), it also calls setup_cache_regions,
engine_from_config, and init_model. These were also invoked explicitly in
celeryd code - these double invocations are dropped too.
Also, make_app_without_logging will call into tg and thus invoke the
setup_configuration hook which will set kallithea.CELERY_ON and call
load_rcextensions. The celeryd code for doing that is thus dropped.
3 files changed with 3 insertions and 18 deletions:
0 comments (0 inline, 0 general)
0 comments (0 inline, 0 general)