open All Channels
seplocked EVE Technology Lab
blankseplocked API - WalletJournal walking and local cache question
 
This thread is older than 90 days and has been locked due to inactivity.


 
Author Topic

fenistil
Posted - 2011.06.30 10:53:00 - [1]
 

Hi,

I saw on the forums that walletjournal does not return a sorted list of entries. Does that mean that even if I specify fromID it is possible to have an entry returned multiple times on different "pages" of the requests and some of the entries never be returned?

Another quesiton: Modified Short Cache returns cacheduntil value to be the same as the currenttime in some cases, eg: CharacterID.xml.aspx . Does it means that all pages using Modified Short Cache can be queries unlimited time and local cache is not required for those pages?

Trenker
Posted - 2011.06.30 11:46:00 - [2]
 

Originally by: fenistil
I saw on the forums that walletjournal does not return a sorted list of entries. Does that mean that even if I specify fromID it is possible to have an entry returned multiple times on different "pages" of the requests and some of the entries never be returned?


I am not a wallet expert, but this is what I know:
The list is unordered, but has all entries once, so missing / multiple entires can only occur if you set the fromID parameter wrong.

Basically you can think of it as a LIMT clause in an unordered SQL query result.

Originally by: fenistil
Another quesiton: Modified Short Cache returns cacheduntil value to be the same as the currenttime in some cases, eg: CharacterID.xml.aspx . Does it means that all pages using Modified Short Cache can be queries unlimited time and local cache is not required for those pages?


Yes, but be careful or they put you on a black list Wink
I for one simply let the API lib I use handle that.

Hel O'Ween
Men On A Mission
EVE Trade Consortium
Posted - 2011.06.30 13:59:00 - [3]
 

Originally by: fenistil
Another quesiton: Modified Short Cache returns cacheduntil value to be the same as the currenttime in some cases, eg: CharacterID.xml.aspx . Does it means that all pages using Modified Short Cache can be queries unlimited time and local cache is not required for those pages?


Simple rule: never query a second time until cachedUntil has expired, no matter what.

This terms "Modified Short Cache" is something descriptive the people came up with when describing the different caching times. I won't rely on its categorisation of API calls to fall under those.

fenistil
Posted - 2011.06.30 18:51:00 - [4]
 

Originally by: Trenker

I am not a wallet expert, but this is what I know:
The list is unordered, but has all entries once, so missing / multiple entires can only occur if you set the fromID parameter wrong.


Alright, how can I set it wrong or right? Once I retrieve the list of entries, shall I look for the one with lowest refID and use that as a fromID parameter?

Hel O'Ween
Men On A Mission
EVE Trade Consortium
Posted - 2011.06.30 20:01:00 - [5]
 

Exactly.

It's good practice to never rely on some assumptions on how input will be presented to your application. Always assume the worst case aka "CCP tries to fool you". Wink

fenistil
Posted - 2011.07.01 07:16:00 - [6]
 

Well thanks for the tips folks.

seems like uasort does help. :)

Hel O'Ween
Men On A Mission
EVE Trade Consortium
Posted - 2011.07.01 13:51:00 - [7]
 

Not sure how "uasort" works (I guess it's some kind of sorting algo), but depending on its implementation, it might be cheaper computing-wise (=faster) to just compare and do a simple (pseudo code) ...

If currentRowID < lastRowID Then
lastRowID = currentRowID

... because you don't necessarily need the whole stuff sorted, but just MIN(rowID).

Dragonaire
Caldari
Corax.
PURgE Alliance
Posted - 2011.07.02 04:32:00 - [8]
 

Yapeal uses the the method Hel O'Ween suggested as it much easier since you have to walk through rows anyway while parsing no need to do it twice in effect by trying to sort it.


 

This thread is older than 90 days and has been locked due to inactivity.


 


The new forums are live

Please adjust your bookmarks to https://forums.eveonline.com

These forums are archived and read-only