HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //usr/local/lib/python3.9/site-packages/celery/bin/result.py
"""The ``celery result`` program, used to inspect task results."""
import click

from celery.bin.base import CeleryCommand, CeleryOption, handle_preload_options


@click.command(cls=CeleryCommand)
@click.argument('task_id')
@click.option('-t',
              '--task',
              cls=CeleryOption,
              help_group='Result Options',
              help="Name of task (if custom backend).")
@click.option('--traceback',
              cls=CeleryOption,
              is_flag=True,
              help_group='Result Options',
              help="Show traceback instead.")
@click.pass_context
@handle_preload_options
def result(ctx, task_id, task, traceback):
    """Print the return value for a given task id."""
    app = ctx.obj.app

    result_cls = app.tasks[task].AsyncResult if task else app.AsyncResult
    task_result = result_cls(task_id)
    value = task_result.traceback if traceback else task_result.get()

    # TODO: Prettify result
    ctx.obj.echo(value)