randomcarl / cr-data-manager

Automatically exported from code.google.com/p/cr-data-manager
0 stars 0 forks source link

backgroundWorker can be cancelled only after the complete ruleset collection is on a book is finished #88

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
T3K:

When processing all rules over one book in a single go it makes cancelling a 
process take as long as it takes to run every rule over that entire list of 
rules. I would suggest processing one rule at a time.

instead of this

if not backgroundWorker1.CancellationPending:
   for book in books:

something like this

for book in books:
    for process in processes:
          if not backgroundWorker1.CancellationPending:
               process.ProcessBook(book)

Original issue reported on code.google.com by rainer.c...@googlemail.com on 29 May 2013 at 6:38

GoogleCodeExporter commented 9 years ago
actually might be better to check for cancellation at both levels

for book in books:
    if not backgroundWorker1.CancellationPending:
        for process in processes:
             if not backgroundWorker1.CancellationPending:
                  process.ProcessBook(book)

Original comment by NiceziaVincent on 29 May 2013 at 7:54

GoogleCodeExporter commented 9 years ago
fixed with 1.1.0

Original comment by rainer.c...@googlemail.com on 30 May 2013 at 10:48