Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

How BuySYS Works

Tim Davis edited this page Sep 3, 2018 · 1 revision

How it Works

BuySYS is a pretty simple application, but some of the design choices I made may confuse people.

Pulling Market Data

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

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.

Flow

  1. User submits estimate
  2. BuySYS checks Cache for any items that are within 30 minutes
  3. 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
  4. BuySYS builds the estimate list and displays to user

Gotchas

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.

Clone this wiki locally