added two output

This commit is contained in:
mxr612 2024-08-23 13:21:49 +08:00
parent c421c885d4
commit 2d8b314e32
2 changed files with 18 additions and 14 deletions

View File

@ -11,6 +11,7 @@ app = FastAPI()
def query(query:str): def query(query:str):
res = [] res = []
try:
list = search_paper(query) list = search_paper(query)
for i in list: for i in list:
if mysql_connector.is_loaded(i['paperId']): if mysql_connector.is_loaded(i['paperId']):
@ -24,6 +25,8 @@ def query(query:str):
'score':[] 'score':[]
}) })
print('New load: '+str(len(res))+'/'+str(len(list))) print('New load: '+str(len(res))+'/'+str(len(list)))
except Exception as e:
print(str(e))
return res return res
@app.get("/fastdoi") @app.get("/fastdoi")
@ -37,7 +40,7 @@ async def get_reference(questions):
@app.get("/rss") @app.get("/rss")
async def miniflux_rss(): async def miniflux_rss():
load_rss() return load_rss()
if __name__ == '__main__': if __name__ == '__main__':
import uvicorn import uvicorn

1
rss.py
View File

@ -48,3 +48,4 @@ def load_rss():
if len(loaded) > 0: if len(loaded) > 0:
update(loaded) update(loaded)
print(f"Total entries loaded: {count}") print(f"Total entries loaded: {count}")
return f"Total entries loaded: {count}"