Skip to content

Celery groups

Hello, im doing a small scrapper using flask and celery, I want to run these scrappers in a celery group. But i cant get my head arround getting the results!in a flaks view i add my task::tarea = group(tlarga2.s(), tlarga2.s())tarea = tarea.apply_async(countdown=30)print(‘Task ID: “{}” sento to Celery’.format(tarea.id))return render_template(‘pbusca.html’, JOBID=tarea.id)In another view I want to get its state and result with:jobid = request.values.get(‘jobid’)job = GroupResult.restore(jobid, app=celery)print(“job es:”.format(job))app.logger.debug(“Informe para tarea: {}”.format(jobid))if job.ready():print(job.get())

ucuz oto beğeni satın al