question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

asyncResult created from task ID does not return anything

See original GitHub issue

Description

I do this

const taskIdResult = celery.client.asyncResult("95be403e-4b67-4edf-82e8-dbbae9f1c99f");
result = taskIdResult.get()
console.log(result)

but get nothing. At the same time I can print taskIdResult with no problem

AsyncResult {
  taskId: '95be403e-4b67-4edf-82e8-dbbae9f1c99f',
  backend: RedisBackend {
    redis: Redis {
      options: [Object],
      _events: [Object: null prototype] {},
      _eventsCount: 0,
      _maxListeners: undefined,
      scriptsSet: {},
      addedBuiltinSet: Set(0) {},
      commandQueue: [Denque],
      offlineQueue: [Denque],
      connectionEpoch: 1,
      connector: [StandaloneConnector],
      retryAttempts: 0,
      _addedScriptHashes: {},
      _autoPipelines: Map(0) {},
      _runningAutoPipelines: Set(0) {},
      _addedScriptHashesCleanInterval: Timeout {
        _idleTimeout: 60000,
        _idlePrev: [TimersList],
        _idleNext: [TimersList],
        _idleStart: 4528,
        _onTimeout: [Function (anonymous)],
        _timerArgs: undefined,
        _repeat: 60000,
        _destroyed: false,
        [Symbol(refed)]: true,
        [Symbol(kHasPrimitive)]: false,
        [Symbol(asyncId)]: 14,
        [Symbol(triggerId)]: 13
      },
      status: 'connecting',
      condition: [Object],
      [Symbol(kCapture)]: false
    }
  },
  _cache: null
}

Task exists in celery and is succeeded. Please help

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
vladimirtiukhtincommented, Mar 4, 2022

Thanks for the prompt response @actumn I tried that. It just does not look like it returns a promise. applyAsync does and I can use “then” on it and get result back, but asyncResult does not

0reactions
actumncommented, Apr 17, 2022

I was pretty confident that program waits at where “then” is placed. Switching to “await” fixed it

Happy to hear that 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Retrieve task result by id in Celery - Stack Overflow
It works using AsyncResult . (see this answer). So first create the task: from cel.tasks import add res = add.delay(3,4) print(res.status) # 'SUCCESS' ......
Read more >
AsyncResult loses .parent when being retrieved via ... - GitHub
The issue is my AsyncTask returned from the Chord loses it's ... chord(group_tasks)(callback) task.id task.parent task.parent.children.
Read more >
result - Celery 5.2.7 documentation
AsyncResult (id, backend=None, task_name=None, app=None, ... Wait until task is ready, and return its result. Warning ... Does nothing if it's not a...
Read more >
How to use the celery.result.AsyncResult function in ... - Snyk
To help you get started, we've selected a few celery.result. ... If the AsyncResult status is PENDING it means there is no celery...
Read more >
celery.result — Celery 3.1.11 documentation
AsyncResult(id, backend=None, task_name=None, app=None, ... Wait until task is ready, and return its result. Warning ... If it is not a member, do...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found