The post() is a bit magical.  It records the function call & parameters into
mongo as a "task".  Then the taskd process sees that there is a task ready to
run, and runs it.

So bulk_edit doesn't run in the main web process, it runs in the taskd process.
Therefore, if you make some code changes, you will need to restart the taskd
process.  You should be able to use ipdb with taskd, if you run `paster taskd
...` directly (don't use nohup or anything like that which runs in the 
background)

On 4/3/17 4:46 PM, Huzaifa Faruqui wrote:
> Solved that issue(I was doing something silly). However, I am still not
> able to understand how post() method is working. Even though
> tasks.bulk_edit.post(**post_data) is doing what it is supposed to do, but
> changing anything in bulk_edit() or adding any debug statements in it
> (simple print or ipdb) is not being reflected as if bulk_edit() is not
> being called.
> 
> On Mon, Apr 3, 2017 at 8:54 PM, Dave Brondsema <d...@brondsema.net> wrote:
> 
>> On 4/3/17 10:12 AM, Huzaifa Faruqui wrote:
>>> When I bulk edit tickets and save changes I get 'Update Scheduled' flash
>> on
>>> the screen. However, changes do not take place. I see that that the
>>> tasks.bulk_edit() method has been decorated & a new method 'post' has
>> been
>>> added to it which adds some sort of delay in ticket update. But in my
>> case
>>> there is infinite delay. I have also ensured that mongod, solr, taskd are
>>> running in the background. How to resolve this behaviour?
>>>
>>
>> All functions that have the @task decorator get a .post() method added to
>> them,
>> which has them run in the background on the taskd process.  A bit more info
>> here: https://forge-allura.apache.org/docs/platform/message_bus.html
>>
>> The bulk edit for tickets uses this since it can take several seconds or
>> more to
>> run, when you are updating lots of tickets.
>>
>> So having taskd running is necessary of course.  What does the taskd log
>> output
>> say?  It should have at least one line about running the bulk edit task,
>> maybe
>> more.  You can also go to the /nf/admin/task_manager URL to find the task
>> and
>> see its status & output (may need to use the ">" arrow to page back
>> further in
>> time; or use ?minutes=100 etc in the URL, to find the task if it was a
>> while ago)
>>
>>
>> --
>> Dave Brondsema : d...@brondsema.net
>> http://www.brondsema.net : personal
>> http://www.splike.com : programming
>>               <><
>>
> 



-- 
Dave Brondsema : d...@brondsema.net
http://www.brondsema.net : personal
http://www.splike.com : programming
              <><

Reply via email to