Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

miscellaneous cleanup of ilsgateway migration code #6421

Merged
merged 12 commits into from
Apr 24, 2015
Merged

Conversation

czue
Copy link
Member

@czue czue commented Apr 22, 2015

can be read commit-by-commit

one bugfix in 598e008

the rest of this is mostly just moving stuff around to try and understand it better.

@kkrampa do you want to take a look at this? cc @kaapstorm

# create stockout alerts
product_data = ProductAvailabilityData.objects.filter(supply_point=facility_id, date=date, without_stock=1)
for p in product_data:
create_multilevel_alert(facility_id, date, const.PRODUCT_STOCKOUT, {'org': facility_id, 'product': p.product})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E501 line too long (118 > 115 characters)

from custom.ilsgateway.tasks import report_run
from custom.ilsgateway.tanzania.warehouse import updater

class Command(BaseCommand):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E302 expected 2 blank lines, found 1

@czue
Copy link
Member Author

czue commented Apr 23, 2015

@kkrampa @kaapstorm I think this is good to merge and would be nice to get it in to avoid future conflicts. @kkrampa let me know if you disagree

@kkrampa
Copy link

kkrampa commented Apr 24, 2015

@czue I tested locally runner and it works as before your changes. Regarding of get_nested_children function luckily problem that you described didn't cause any problems. Maybe we need to change this function later.

@kaapstorm
Copy link
Contributor

👍

@czue
Copy link
Member Author

czue commented Apr 24, 2015

rebased with master - i think this is good to go (feel free to wait for tests)

res = chain(
process_non_facility_warehouse_data.si(org, start_date, end_date, runner, strict)
for org in chunk
)()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious: Is there a reason we chain these (sequentially) instead of grouping them (in parallel)? i.e.

    res = group(
        process_non_facility_warehouse_data.si(org, start_date, end_date, runner, strict)
        for org in chunk
    )()

And could we chain the groups, or stick them all in a single group/chain?, i.e.

    res = chain(
        group(
            process_non_facility_warehouse_data.si(org, start_date, end_date, runner, strict)
            for org in chunk
        )()
        for chunk in non_facilities_chunked_list
    )()
    res.get()

(Not that it would make a significant performance improvement if we could, because it's all happening in the background queue. Just trying to figure out why we do it the way we do.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure - it might be because of the memory issues pointed out by @kkrampa here: 598e008#commitcomment-10855444 or it might just never have been considered to run in parallel (this code was just moved around so @kkrampa is best positioned to answer)

@kkrampa
Copy link

kkrampa commented Apr 24, 2015

@kaapstorm Please look at my answer in url that Cory posted.

@kaapstorm
Copy link
Contributor

Ah. Thanks @kkrampa.

benrudolph added a commit that referenced this pull request Apr 24, 2015
miscellaneous cleanup of ilsgateway migration code
@benrudolph benrudolph merged commit a78ff0a into master Apr 24, 2015
@benrudolph benrudolph deleted the ils-deep-dive branch April 24, 2015 17:22
@benrudolph
Copy link
Contributor

any reason travis didn't run on this?

@czue
Copy link
Member Author

czue commented Apr 24, 2015

I think because I rebased and the last commit had [ci skip]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants