core/services/search.py

18 lines
389 B
Python
Raw Normal View History

2022-10-04 00:32:29 +00:00
import asyncio
from orm.shout import Shout
class SearchService:
lock = asyncio.Lock()
cache = {}
@staticmethod
2022-10-04 09:25:59 +00:00
async def init(session):
async with SearchService.lock:
SearchService.cache = {}
2022-10-04 00:32:29 +00:00
@staticmethod
async def search(text) -> [Shout]:
2022-10-04 09:25:59 +00:00
async with SearchService.lock:
2022-10-04 00:32:29 +00:00
return [] # TODO: implement getting shouts list