Skip to content

Commit

Permalink
Tune performance (caching API status calls)
Browse files Browse the repository at this point in the history
Fixes #990
  • Loading branch information
mattyweb committed Mar 4, 2021
1 parent 4d2ad5f commit ff817fd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/api/code/lacity_data_api/services/status.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from aiocache import cached

from ..models import db, cache
from ..config import CACHE_MAXMEMORY


@cached(alias="default")
async def get_last_updated():
query = db.text("SELECT max(created_time) as last_pulled FROM log WHERE status = 'INFO'") # noqa
result = await db.first(query)
Expand Down

0 comments on commit ff817fd

Please sign in to comment.