Skip to content

Commit

Permalink
Fix follow in parallel migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
David Park committed Dec 23, 2020
1 parent c67cad2 commit a311999
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions solvebio/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,7 @@ def migrate(self, target, follow=True, **kwargs):
if follow:
# Multiple migration objects returned
if "data" in migration:
for mig in migration:
mig.follow()
self.activity(follow=True)

This comment has been minimized.

Copy link
@jsh2134

jsh2134 Dec 23, 2020

Contributor

I think it might be worth transitioning to self.activity(follow=True) in both cases - it makes it simpler to determine what follow does. These two calls are not equivalent, although the use case (mostly) is.

migration.follow() is to wait until this migration + commit is finished
dataset.activity() is for any all activity on the dataset

If we do want to monitor only the migration+commits that THIS call fired off, then we should revert this commit to the previous way you had it

This comment has been minimized.

Copy link
@davecap

davecap Dec 23, 2020

Member

good point actually, might make more sense to follow all the migrations as would probably be what the user expects isnt it?

else:
migration.follow()

Expand Down
3 changes: 1 addition & 2 deletions solvebio/resource/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,7 @@ def migrate(self, target, follow=True, **kwargs):
if follow:
# Multiple migration objects returned
if "data" in migration:
for mig in migration:
mig.follow()
self.activity(follow=True)
else:
migration.follow()

Expand Down

0 comments on commit a311999

Please sign in to comment.