mirror of
https://github.com/ltcptgeneral/cs239-caching.git
synced 2026-02-03 06:31:02 +00:00
prefetch test
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from fastapi import FastAPI, HTTPException
|
||||
from database import get_user_ids, get_user_profile, update_user_profile
|
||||
from database import get_user_ids, get_user_profile, update_user_profile, get_user_friend_ids
|
||||
from cache.cache import BaselineCache
|
||||
from cache.prefetch_cache import PrefetchCache
|
||||
from cache.tiered_cache import TieredCache
|
||||
@@ -25,6 +25,10 @@ else:
|
||||
def fetch_user_ids():
|
||||
return {"ids": get_user_ids()}
|
||||
|
||||
@app.get("/users_and_friends")
|
||||
def fetch_user_and_friends():
|
||||
return get_user_friend_ids()
|
||||
|
||||
@app.get("/user/{user_id}")
|
||||
def fetch_user_profile(user_id: str):
|
||||
"""Fetch user profile with caching"""
|
||||
|
||||
Reference in New Issue
Block a user