From acc19dafdbc93c920c1d1db26cb9d75526a8bd79 Mon Sep 17 00:00:00 2001 From: sara-santana Date: Fri, 29 Nov 2024 10:44:53 +0000 Subject: [PATCH] collusion test --- beacon/scripts/collusion_test.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/beacon/scripts/collusion_test.py b/beacon/scripts/collusion_test.py index 9258eefc..f157bbb6 100644 --- a/beacon/scripts/collusion_test.py +++ b/beacon/scripts/collusion_test.py @@ -88,21 +88,20 @@ def query_variant_with_curl(access_token, alt, ref, start, end, vType): return result.stdout, result.stderr -def update_user_budget_to_initial(individual_id): - +def update_individual_budget(individual_id): try: budget_collection = client.beacon['budget'] + #LOG.debug(f"Updating budget for individual_id={individual_id} by amount={amount}") + + # Find the document and update it, returning the updated document updated_document = budget_collection.find_one_and_update( - {"individualId": individual_id, "userId": "Bearer collusion"}, + {"individualId": individual_id}, {"$set": {"budget": -math.log10(0.5)}}, return_document=ReturnDocument.AFTER # Return the updated document ) + return updated_document - - - print("BLA BLA BLA") - print("THE BUDGET WAS UPDATED, SO 1 MORE USER") - print("!!!!!!!!!!!!!!!!!!!!!!!!!!!") + except Exception as e: return None