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

GuiDBTuples credit mining removal #2398

Merged
merged 4 commits into from
Oct 19, 2016

Conversation

ardhipoetra
Copy link
Contributor

@ardhipoetra ardhipoetra commented Jul 2, 2016

As fix for Issue #2356.

This will remove Main package dependencies on credit mining. It might be slow when downloading the credit source, but it works. How can I download the torrent via DHT/Peers?

Btw, made PR into next because this is a bugfix for experimental feature (credit mining)

@ardhipoetra ardhipoetra changed the title GuiDBTuples credit mining removal WIP: GuiDBTuples credit mining removal Jul 2, 2016
@ardhipoetra
Copy link
Contributor Author

Mind to review, @devos50, @lfdversluis?

self.loaded_torrent[infohash] = tdef

if callback is not None:
callback(tdef)
Copy link
Contributor

Choose a reason for hiding this comment

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

you may want to use a deferred here

@ardhipoetra
Copy link
Contributor Author

@lfdversluis pushed commits on your feedback. What do you think?

@ardhipoetra
Copy link
Contributor Author

retest this please

@ardhipoetra
Copy link
Contributor Author

I'm pretty finished with this one. Any thoughts, @devos50, @whirm?

@ardhipoetra
Copy link
Contributor Author

retest this please

@ardhipoetra
Copy link
Contributor Author

retest this please

error in mac, TestDownloadsEndpoint.test_get_downloads

@ardhipoetra ardhipoetra mentioned this pull request Jul 14, 2016
122 tasks
self.torrents[infohash]['num_seeders'] = torrent.swarminfo[0] or 0
self.torrents[infohash]['num_leechers'] = torrent.swarminfo[1] or 0
self.torrents[infohash]['name'] = torrent.get_name()
self.torrents[infohash]['metainfo'] = torrent
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the torrent object really represent the metainfo of the torrent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think yes, torrent object is a TorrentDef type

@devos50
Copy link
Contributor

devos50 commented Jul 14, 2016

@ardhipoetra I gave my comments. Overall, it looks good and I'm glad you are able to remove much code in this PR :)

@ardhipoetra
Copy link
Contributor Author

@devos50 processed! :D

@ardhipoetra
Copy link
Contributor Author

ardhipoetra commented Jul 15, 2016

retest this please

credit mining error in Mac

@ardhipoetra
Copy link
Contributor Author

retest this please

@devos50
Copy link
Contributor

devos50 commented Jul 18, 2016

@ardhipoetra looks fine, let's put it on ready so @whirm can take a look.

@ardhipoetra ardhipoetra changed the title WIP: GuiDBTuples credit mining removal READY: GuiDBTuples credit mining removal Jul 18, 2016
@ardhipoetra
Copy link
Contributor Author

@devos50 Thanks! :D

@whirm
Copy link
Contributor

whirm commented Jul 19, 2016

This check_and_register() function looks a bit fishy... why do you need this?

Also the _check_tor looping call should be canceled instead of having the triple check on BoostingSource.py:293

Copy link
Contributor

@devos50 devos50 left a comment

Choose a reason for hiding this comment

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

@ardhipoetra looks good 👍 . Besides my looping call comment, I have one additional question: can you squash the first commit (where you remove the dependency on GUIDBTuple) and the commit(s) where you refactor the _load_torrent method to use deferreds?

After that, please squash and I will merge if it's ok.

"""
check if a torrent has been loaded
"""
if defer_param is None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use the looping call mechanism here that I recently adopted in your tests (see the other tests in this file to see how I did that).

@ardhipoetra ardhipoetra force-pushed the guituples_cm_removal branch 7 times, most recently from 1e2d71c to 2094ebd Compare October 18, 2016 10:34
@ardhipoetra
Copy link
Contributor Author

retest this please

looks good

@ardhipoetra
Copy link
Contributor Author

retest this please

last run okay

@ardhipoetra
Copy link
Contributor Author

ardhipoetra commented Oct 18, 2016

retest this please

last run : error in linux, get_settings Rest Api

@synctext
Copy link
Member

retest this please

@ardhipoetra
Copy link
Contributor Author

looks stable enough for me. What do you think @devos50?

@synctext
Copy link
Member

retest this please

5 similar comments
@synctext
Copy link
Member

retest this please

@synctext
Copy link
Member

retest this please

@synctext
Copy link
Member

retest this please

@synctext
Copy link
Member

retest this please

@synctext
Copy link
Member

retest this please

Copy link
Contributor

@devos50 devos50 left a comment

Choose a reason for hiding this comment

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

Please remove the indicated commented-out code line, squash your last two commits (where you create the test and refactor it with the looping call) and I will merge 👍

def add_to_loaded(infohash_str):
"""
function to add loaded infohash to memory
"""
self.loaded_torrent[unhexlify(infohash_str)].callback(
TorrentDef.load_from_memory(self.session.get_collected_torrent(unhexlify(infohash_str))))
self.loaded_torrent[unhexlify(infohash_str)] = None

# self.loaded_torrent[unhexlify(infohash_str)] = None
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this commented-out code.

Squashed commits with :
- Use looping call in checking loaded torrent
@ardhipoetra
Copy link
Contributor Author

@devos50 ready!

@devos50 devos50 merged commit ec94554 into Tribler:next Oct 19, 2016
@devos50 devos50 changed the title WIP: GuiDBTuples credit mining removal GuiDBTuples credit mining removal Oct 19, 2016
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.

None yet

5 participants