Compare commits

..

2 Commits

Author SHA1 Message Date
Yaojia Wang
e797f8929d fix: use fmp provider for price_target endpoint
Some checks reported errors
continuous-integration/drone/push Build was killed
yfinance is not supported by obb.equity.estimates.price_target,
which only accepts benzinga or fmp.
2026-03-19 00:13:07 +01:00
Yaojia Wang
d46e8685d7 ci: add RBAC for drone to restart invest-api deployment 2026-03-18 23:50:11 +01:00
3 changed files with 25 additions and 1 deletions

23
k8s/base/drone-rbac.yaml Normal file
View File

@@ -0,0 +1,23 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: drone-deploy
namespace: invest-api
rules:
- apiGroups: ["apps"]
resources: ["deployments"]
verbs: ["get", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: drone-deploy
namespace: invest-api
subjects:
- kind: ServiceAccount
name: default
namespace: drone
roleRef:
kind: Role
name: drone-deploy
apiGroup: rbac.authorization.k8s.io

View File

@@ -9,4 +9,5 @@ resources:
- deployment.yaml - deployment.yaml
- service.yaml - service.yaml
- ingress.yaml - ingress.yaml
- drone-rbac.yaml

View File

@@ -106,7 +106,7 @@ async def get_financials(symbol: str) -> dict:
async def get_price_target(symbol: str) -> float | None: async def get_price_target(symbol: str) -> float | None:
try: try:
result = await asyncio.to_thread( result = await asyncio.to_thread(
obb.equity.estimates.price_target, symbol, provider=PROVIDER obb.equity.estimates.price_target, symbol, provider="fmp"
) )
items = _to_dicts(result) items = _to_dicts(result)
if items: if items: