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

Switch tov2 items #154

Merged
merged 7 commits into from
Oct 4, 2014
Merged

Conversation

keneanung
Copy link
Contributor

This branch completely switches Item updates (not listing updates) to the official GW2 API v2.

I also took the liberty to remove the classes associated with the ItemDB-Queue as it is not needed anymore. I hope I did not overlook any references.

The scripts called in the daemons directory now output an error message and exit with code 1 if they are called. That way no cron job or other automated call should slip past.

The puppet stage of the provisioning by vagrant now also installs node.js and
grunt. This is needed for the following call of bin/update.sh to make sure all
js and css files are available.
This prevents us from using any public Type/Subtype/Rarity IDs. We create our own, if we encounter a new type, but that means, we can't make sure, IDs are stable in dev environments. We should probably check in a SQL-File with "our" ID->Title tables.

 Disable instance pooling of Propel, because we will get memory problems otherwise...
Puppet will now:
- import known types, sub-types and disciplines. That way we keep our IDs stable
- clear our caches and set the request slots up
- run tools/update-items-from-api.php to get the initial batch of items. Due to the amount of items, the provisioning will take quite some time and php will be swapping a lot in the end...
These classes are only slightly changed copies from the v1 API. Using the v2 API shortens the update-items-from-api.php by about a third.
This commit finishes the move to the v2/items-API of GW. We can now:
- nix the ItemDB-Queue (which happened, the workers will output a message and exit with code 1)
- use tools/update-items-from-api.php for item updates. The script runs about 5 minutes and creates new (Sub)Types if needed.

I also adapted the Readme.
@keneanung
Copy link
Contributor Author

Hmmm... I've been playing around withthose changes and the way the priority queue is currently written makes adding new types dynamically a little tricky... For example currently the type "back" gets created. If you want to fill the item listing queue however, it does not know which priority this type should get.

Since the commerce API allows us to fetch up to 200 (I think?) items at once, I am also not sure if the priority stuff is still needed at all.

This is needed to be able to put the back items into the item listings queue.

More adaptions to the Readme and disable instance pooling for propel on importing the recipe map... That prevents swapping and makes the import faster by a HUGE amount.
@rubensayshi
Copy link
Owner

hmm, we can change the worker to do up to 200 items in 1 requests at least to speed things up.

I'd like to keep the priority system in place though, over the past years I've gone back and forth between different ways of fetching the prices and the priority system has always been a way of mitigating the pain when the method of fetching the prices was slow.
We can add a default case with PRIO_TWO I guess to be able to handle new types.

@rubensayshi
Copy link
Owner

I took some time to look through the diff and the PR looks good btw, I just need to test and deploy it, I'm trying really hard to make some time for that, hopefully this evening!

@keneanung
Copy link
Contributor Author

Take your time. I won't have much time this weekend to set the default
value anyways. Sometimes I also noticed some strange glitches, which I
couldn't look at yet.

@rubensayshi rubensayshi merged commit e523905 into rubensayshi:master Oct 4, 2014
@rubensayshi
Copy link
Owner

it's working better than the currently broken scripts so an improvement at the very least.
what glitches are you talking about?

if it has to do with failing requests, I got a different library to do the multicurl a bit better if necesary

@keneanung
Copy link
Contributor Author

Well... I noticed that sometimes I got single null elements in the arrays
returned from Itemv2::getMultipleItemsByJSON. Also some (changing) items
threw caught exceptions.

But both happened when I queried by IDs instead of using paging. I forgot to
check it with the paging.

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.

2 participants