題外話:過了幾年的自學,現在終於出社會找到軟體相關工作了QQ
如題,我是使用redis(window版)配celery,並且是在虛擬環境裡面跑這段簡單的程式碼add(x,y),celery可以收到任務但是會超時,已經確認過防火牆沒有擋port:6379,celery的mudule也更新到最新了,但是在執行result.get()時還是會報錯TimeoutError: The operation timed out.,請問各位大神我是哪邊出錯了
C:\Users\User\Desktop\tasks.py
from celery import Celery
app = Celery('tasks', broker='redis://localhost:6379/0', backend='redis://localhost:6379/0')
@app.task
def add(x, y):
return x + y
C:\Users\User\Desktop\123.py
from tasks import add
result = add.delay(4, 6)
print('Task result:', result.get(timeout=10))