Skip to content

Commit

Permalink
Update report.py
Browse files Browse the repository at this point in the history
  • Loading branch information
extreme4all authored May 16, 2024
1 parent e323c9f commit decb904
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/api/v1/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ async def insert_active_reporter(reporter: str):

async def insert_report_v2(detections: list[detection]):
try:
url = 'https://api.prd.osrsbotdetector.com/v2/report'
url = 'http://private-api-svc.bd-prd.svc:5000/v2/report'
data = [d.dict() for d in detections]
async with aiohttp.ClientSession() as session:
async with session.post(url=url, json=data) as response:
Expand All @@ -235,8 +235,8 @@ async def insert_report(
"""
Inserts detections into to the plugin database.
"""
# if random.randint(1, 10) == 1:
# asyncio.create_task(insert_report_v2(detections))
if random.randint(1, 10) == 1:
asyncio.create_task(insert_report_v2(detections))
# remove duplicates
df = pd.DataFrame([d.dict() for d in detections])
df.drop_duplicates(subset=["reporter", "reported", "region_id"], inplace=True)
Expand Down

0 comments on commit decb904

Please sign in to comment.