Skip to content

Commit

Permalink
fix: 移除无用组件
Browse files Browse the repository at this point in the history
  • Loading branch information
linyuan0213 committed Nov 18, 2024
1 parent 1c2ec89 commit 5f30963
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions app/helper/plugin_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,19 @@ def install(plugin_id):
"""
插件安装统计计数
"""
return RequestUtils(timeout=5).get(f"https://nastool.cn/plugin/{plugin_id}/install")
return None

@staticmethod
def report(plugins):
"""
批量上报插件安装统计数据
"""
return RequestUtils(content_type="application/json",
timeout=5).post(f"https://nastool.cn/plugin/update", json={
"plugins": [{"plugin_id": plugin, "count": 1} for plugin in plugins]
})
return None

@staticmethod
@cached(cache=TTLCache(maxsize=1, ttl=3600))
def statistic():
"""
获取插件安装统计数据
"""
ret = RequestUtils(accept_type="application/json",
timeout=5).get_res("https://nastool.cn/plugin/statistic")
if ret:
try:
return ret.json()
except Exception as e:
print(e)
return {}

0 comments on commit 5f30963

Please sign in to comment.