Class MenuItemsLoader

java.lang.Object
edu.ucsb.cs156.dining.services.MenuItemsLoader

@Service public class MenuItemsLoader extends Object
Downloads every MenuItem for the current month from the UCSB Dining API and stores them in the database. Intended to be called once at startup, so that users don't depend on someone having visited a given day's menu for its items to exist.

Requests that get an HTTP 429 (Too Many Requests) are retried with exponential backoff (honoring a Retry-After header when present). If the retries are exhausted, the whole load stops rather than continuing to hammer the API. If the API key is not configured, no requests are sent at all.

  • Field Details

  • Constructor Details

  • Method Details

    • loadCurrentMonth

      public void loadCurrentMonth()
      Loads all MenuItems for every day of the current month, for every dining commons. Never throws: problems are logged.