Runtask
snoop.data.management.commands.runtask
#
Runs task in the foreground.
Equivalent of using snoop.data.management.commands.retrytasks.
Classes#
Command
#
Runs a task in foreground
Methods#
add_arguments(self, parser)
#
Entry point for subclassed commands to add custom arguments.
Source code in snoop/data/management/commands/runtask.py
def add_arguments(self, parser):
parser.add_argument('collection', type=str)
parser.add_argument('task_pk', type=int)
handle(self, *args, *, collection, task_pk, **options)
#
The actual logic of the command. Subclasses must implement this method.
Source code in snoop/data/management/commands/runtask.py
def handle(self, *args, collection, task_pk, **options):
logging_for_management_command()
col = collections.ALL[collection]
tasks.laterz_snoop_task(col.db_alias, task_pk, raise_exceptions=True)