-
Notifications
You must be signed in to change notification settings - Fork 3
How BuySYS Works
BuySYS is a pretty simple application, but some of the design choices I made may confuse people.
Market data is pulled every 30 minutes for all the items listed in the Ore Tables area. This is to provide the most up to date data to your users.
Market data for all other items are pulled as needed upon receiving an estimate request. The items pulled in this fashion are cached for 30 minutes. This prevents pounding Fuzzworks API with too many calls. Any subsequent estimates submitted within the 30 minute window will use the price in the cache.
Buy Back Rules are meant to take the Market Price of an item and run some transformations on it based on the rules you have created. After all the rules are processed the system arrives at the 'adjusted' price of an item. This 'adjusted' price is stored in the cache along side the raw market price. This is done to save on DB calls and processing time.
- User submits estimate
- BuySYS checks Cache for any items that are within 30 minutes
- BuySYS pulls new Market data for any stale or non present items
- BuySYS then merges all the rules for each item to come to a final adjustment rule
- BuySYS applys the final adjustment rule to the Market Price and stores in Cache
- BuySYS builds the estimate list and displays to user
Since the entire system is running on a 30 minute cache, you may come across timing issues. If you change any setting that effects the price, tax, can buy, refined, where price data comes from you will need to clear the cache and then repopulate it using the Admin --> Admin Tools section.
Clear Cache: Dumps the contents of the Cache database, nothing remains! Populate Cache: Pulls Market Data for the default set of items (ore tables) and stores it in cache.