Skip to content
TORNLIFE More

Faction Attacks Cache

Started by Tyler [23890] on in API Development.

7 replies · 139 views · thread synced · 5 days ago · View on torn.com
About this thread

Posts archived: 8 / 8 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
8
Discussion span
→
People posting
5
Likes on archived posts
3
Posts by staff, officers and moderators
1
Authority score
71 / 100
Historical score
21 / 100
Story score
29 / 100
Engagement score
50 / 100
Tyler [23890]
Branching off of this: https://www.torn.com/forums.php#/p=threads&f=19&t=16093460&b=0&a=0&start=0&to=19285264

Once this gets a few comments/upvotes from the normal API crowd I'll post in bug reports for Ched to review.

Dear 6 pound 8 oz baby Ched,

Please rethink not caching the faction attack data when using a to & from, even if you do it for a week and test the load. I don't think it will be as high stress as you think since only faction's chaining are more than likely using it.

If that's not acceptable, can the 100 limit be raised? With one key, it will take over nearly an hour to pull all the attacks to bring a Live Chain report on TornData to the current 'live' data. If you can raise it to 1k, then it's only 5 mins :)

Or create a new selection, 'fullchain' that only returns the full current chain data and cache it for 10 mins or something acceptable to you.

I'm open for other suggestions (from Ched or anyone else using API). My end goal is only to make Live Chain better for all.

Mentions: Same response with different API calls (to/from)

LouBaker [1162207]
The Idea is you have to Cache your own attacknews there isn't any need to have a constant flow of calls to attacknews where people have DoctorN to show they have been attacks

I do Agree that the 30-second delay on user chain and user events need to be live, so apps like DoctorN can give live update events

also, faction chain needs to be live as different apps may use the two different chain request ie: faction chain or user chain

I myself would like faction stats and faction basic live, these two calls are very powerful and are not used or missed out by API users
with these, you don't need to use attacknews where these calls show attacks incoming and outgoing and show members status

Example:

faction stats show's an incoming attack showing hospitaltimereceived calling faction basic and re-reading an already Cache data
you can pull out the member status change's and do a user basic request to test there time in Hospital and match it with the hospitaltimereceived time collected from faction stats

I have been doing this a long time before faction basic had the members status added, it is so accurate I haven't even added the new status to my app

Faction AttackNews

The faction attacknews call doesn't need to be live, members know themselves when they do attacks or receive attacks via DoctorN or other live apps and it is not necessary for other users to know about these in live time, so 30 seconds is ok in my mine

faction attacknewsfull should be on request only by the user, and not auto called every 30 seconds without the user's knowledge
no faction can do 1k attacks in 10 mins or even 15 or 20 minutes to that matter, with the above faction stats call you can count the incoming and outgoing attacks and when there are nearing 100 added together, then use faction attacknews call using the &from(last time call) option to return the latest 100 attacks, these you cache yourself or append them to a file with attacks you have already recorded

There are so many Apps out now misusing the Api's, calling personalstats, stocks, inventory, honours, medals, workstats and so on
As it was pointed out here in this post https://www.torn.com/forums.php#/p=threads&f=19&t=16100301&b=0&a=0

many of these do not change if the user isn't online or active and should only be used by a user request or their activity

So think about these calls when you writing your apps do some real coding and not robots looping around and around doing the same thing over and over

Take away the unnecessary serve loads that chedburn is trying to coup with and we might get our API's working again

There is no need to protest to him about it, You have to sort out your ends
Tyler [23890]
I don't think you understand what I'm doing or asked. I'm not asking for live data per se, I'm asking that to/from's be counted as unique requests instead of caching the selection as it currently does for use in my Live Chain feature on TornData. Take your soap boxing for bad programming to your own thread, this isn't the one for it.
LouBaker [1162207]
Its never going to happen until people slow down on API usage, if you read my soapbox programming you see I agree to live Chains and Events need to be live,

Live Attacking is not necessary you can see live chaining from your main faction page
and you can do hit counts later like this at convenient times and saving our API servers from over loading
Tyler [23890]
The whole API isn't necessary if you just want to argue. Ched has recently been quite open to discussions of change.
Plornt [1799359]
Really though, how can something that just essentially lists out a table rows from a DB cause stability issues? Sounds like something is wrong here. Maybe a good option would be to cache and serve full historic data and web sockets to bring it up to date live. They're definitely able to support something like that considering they already have chat over ws.