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

Make ArtifactCallback work for puts to remote repositories #123

Open
quintesse opened this issue Aug 17, 2015 · 6 comments
Open

Make ArtifactCallback work for puts to remote repositories #123

quintesse opened this issue Aug 17, 2015 · 6 comments

Comments

@quintesse
Copy link
Member

Right now the ArtifactCallback is only called when downloading something from a remote repository and ignored when uploading to it.

Although there might be a different way to solve this, because I'd also like for the callback to be used for local operations, so that for example a copy operation from one local repo to another would also use the callback.

That way the progress report for uploading would automatically work because it would really be showing the progress of the read operations of the local repository.

Thing is all those operations go through AbstractNodeRepositoryManager.addContent() and not through RootRepositoryManager.putContent() where the callback is being handled and I'm not sure what the best way is to handle this. Wdyt @alesj ?

@quintesse quintesse added this to the 1.3 milestone Aug 17, 2015
@alesj
Copy link
Member

alesj commented Aug 18, 2015

@quintesse Let me check out the code ... after 1M years ...

@alesj
Copy link
Member

alesj commented Aug 21, 2015

@quintesse afais, AbstractNodeRepositoryManager.addContent() has it's only impl in RootRepositoryManager.
And that impl always calls RootRepositoryManager::putContent().

@quintesse
Copy link
Member Author

@alesj as you can read from the log.debug() statement you put at the beginning of that method (RootRepositoryManager::putContent()) it only gets called when "Creating local copy of external node", in other words: only when downloading.

@quintesse
Copy link
Member Author

And after some more debugging I can tell you that when uploading the RootRepositoryManager isn't even used! It's the CachingRepositoryManager that does all the work, putArtifact() in line 99 which delegates to AbstractNodeRepositoryManager.putArtifact() in the line 254 which then goes to putArtifactInternal() which uses OpenNode::addContent() to actually upload the artifact.

@alesj
Copy link
Member

alesj commented Aug 21, 2015

@quintesse ok, I must admit I don't follow all the details.
I would say, adjust the callback code as you please.

When I added it, I tried to find the right download place,
I didn't put upload into consideration.

@quintesse
Copy link
Member Author

Well it was not so much that I was asking for permission but for help because I'm not sure at all how to do it ;) But I'll just see what I can break ;)

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

No branches or pull requests

2 participants