Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use rpc as celery backend, always get PENDING result celery version 4.41 #9105

Closed
flyyabelle opened this issue Jun 27, 2024 · 1 comment
Closed

Comments

@flyyabelle
Copy link

celery config:
RMQ = CONFIG['rabbitmq']
broker = 'amqp://{}:{}@{}:{}/{}'.format(RMQ['user'], urlquote(RMQ['password']), RMQ['host'], RMQ['port'], RMQ['vhost'])

app = Celery('iris',
broker=broker,
backend='rpc://',
include=[
'dialog.taskmgr.clear_temporary_file',
'dialog.taskmgr.download_detail_task',
'dialog.taskmgr.business_statistic',
'dialog,taskmgr.tasks'
])

app.conf.update(
result_backend_transport_options={
'visibility_timeout': 3600, # 1 hour
'polling_interval': 2.0 # 2 seconds
},
timezone='Asia/Shanghai',
enable_utc=False
)

@app.task
def add(x, y):
return x y

result = add.apply_async([2, 3])
print(result.id) # 7421ec0a-f4c1-4ed1-af46-aad4020ae575
print(result.get()) # 获取任务结果 ok
print(result.status) # 检查任务状态 # SUCCESS
print(add.AsyncResult(result.id).state) # PENDING
print(add.AsyncResult(result.id).status) # PENDING

why state and status always PENDING
@flyyabelle flyyabelle changed the title use rpc as celery backend, always get PENDING result use rpc as celery backend, always get PENDING result celery version 4.41 Jun 27, 2024
@thedrow
Copy link
Member

thedrow commented Aug 21, 2024

We no longer support Celery 4.
Please upgrade to the latest version of Celery.

@thedrow thedrow closed this as not planned Won't fix, can't repro, duplicate, stale Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants