From 0e3016684de10d89c4989fc24d145e84ac01e7d9 Mon Sep 17 00:00:00 2001 From: sara-santana Date: Fri, 29 Nov 2024 10:28:04 +0000 Subject: [PATCH] collusion test --- beacon/scripts/collusion_test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/beacon/scripts/collusion_test.py b/beacon/scripts/collusion_test.py index 1756ce70..61241df7 100644 --- a/beacon/scripts/collusion_test.py +++ b/beacon/scripts/collusion_test.py @@ -89,16 +89,16 @@ def query_variant_with_curl(access_token, alt, ref, start, end, vType): def update_user_budget_to_initial(individual_id): + try: budget_collection = client.beacon['budget'] - - # Find the document and update it, returning the updated document budget_collection.find_one_and_update( {"individualId": individual_id}, {"$inc": {"budget": -(math.log10(0.5))}}, + return_document=ReturnDocument.AFTER # Return the updated document ) - print("!!!!!!!!!!!!!!!!!!!!!!!!!!!") - budget_info = client.beacon.get_collection('budget').find_one({"individualId": individual_id}) + + budget_info = client.beacon.get_collection('budget').find_one({"individualId": individual_id})['budget'] print("The budget is now: ", budget_info['budget']) print("BLA BLA BLA") print("THE BUDGET WAS UPDATED, SO 1 MORE USER")