diff options
author | Rodney Ewing <ewing.rj@gmail.com> | 2013-08-02 12:06:50 -0700 |
---|---|---|
committer | Rodney Ewing <ewing.rj@gmail.com> | 2013-08-16 15:30:14 -0700 |
commit | f30fbfe60c5cd84cdf5df653d2c281a0bb05bae8 (patch) | |
tree | 63b7628d03727227d467e7ca98407111f9e692fa /mediagoblin/gmg_commands/reprocess.py | |
parent | 9a2c66ca9ef763fa68dc09a483c02fe2ee02d78f (diff) | |
download | mediagoblin-f30fbfe60c5cd84cdf5df653d2c281a0bb05bae8.tar.lz mediagoblin-f30fbfe60c5cd84cdf5df653d2c281a0bb05bae8.tar.xz mediagoblin-f30fbfe60c5cd84cdf5df653d2c281a0bb05bae8.zip |
add option to not run eagerly
Diffstat (limited to 'mediagoblin/gmg_commands/reprocess.py')
-rw-r--r-- | mediagoblin/gmg_commands/reprocess.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/mediagoblin/gmg_commands/reprocess.py b/mediagoblin/gmg_commands/reprocess.py index f6b9e653..9d8ede24 100644 --- a/mediagoblin/gmg_commands/reprocess.py +++ b/mediagoblin/gmg_commands/reprocess.py @@ -13,6 +13,8 @@ # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +import os + from mediagoblin import mg_globals from mediagoblin.db.models import MediaEntry from mediagoblin.gmg_commands import util as commands_util @@ -40,6 +42,10 @@ def reprocess_parser_setup(subparser): '--thumbnails', action="store_true", help="Regenerate thumbnails for all processed media") + subparser.add_argument( + '--celery', + action='store_true', + help="Don't process eagerly, pass off to celery") def _set_media_type(args): @@ -139,13 +145,13 @@ def _set_media_state(args): def reprocess(args): + if not args[0].celery: + os.environ['CELERY_ALWAYS_EAGER'] = 'true' commands_util.setup_app(args[0]) _set_media_state(args) _set_media_type(args) - import ipdb - ipdb.set_trace() if not args[0].media_id: return _reprocess_all(args) |