Skip to content

Commit bf998b8

Browse files
committed
fixed usage
1 parent 9575c38 commit bf998b8

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

bedhost/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.10.4"
1+
__version__ = "0.10.5"

bedhost/helpers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ def count_requests(
9494
def decorator(func):
9595
@wraps(func)
9696
async def wrapper(*args, **kwargs):
97+
98+
function_result = await func(*args, **kwargs)
99+
97100
if event == "files":
98101
file_path = kwargs.get("file_path")
99102
if "bed" in file_path or "bigbed" in file_path.lower():
@@ -128,7 +131,7 @@ async def wrapper(*args, **kwargs):
128131
usage_data.bedset_meta[bedset_id] = 1
129132
else:
130133
raise ValueError(f"Unknown event type: {event}")
131-
return await func(*args, **kwargs)
134+
return function_result
132135

133136
return wrapper
134137

bedhost/main.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,14 @@ def upload_usage():
172172
Upload usage data to the database and reset the usage data
173173
"""
174174

175-
print("Running uploading of the usage")
175+
_LOGGER.info("Running uploading of the usage")
176176
usage_data.date_to = datetime.datetime.now() + datetime.timedelta(
177177
days=USAGE_RECORD_DAYS
178178
)
179-
bbagent.add_usage(usage_data)
179+
try:
180+
bbagent.add_usage(usage_data)
181+
except Exception as e:
182+
_LOGGER.error(f"Error while uploading usage data: {e}")
180183

181184
usage_data.bed_meta = {}
182185
usage_data.bedset_meta = {}

0 commit comments

Comments
 (0)