Skip to content

Commit 0e502d5

Browse files
committed
Fixes
1 parent cb65b37 commit 0e502d5

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

keep/api/core/report_uptime.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import time
12
import asyncio
23
import logging
34
import threading
@@ -18,13 +19,13 @@ async def report_uptime_to_posthog():
1819
Should be lunched in a separate thread.
1920
"""
2021
while True:
21-
start_time = asyncio.get_event_loop().time()
22+
start_time = time.time()
2223
properties = {
2324
"status": "up",
2425
"keep_version": KEEP_VERSION,
2526
**get_activity_report(),
2627
}
27-
end_time = asyncio.get_event_loop().time()
28+
end_time = time.time()
2829
properties["db_request_duration_ms"] = int((end_time - start_time) * 1000)
2930
posthog_client.capture(
3031
get_or_creat_posthog_instance_id(),

keep/server_jobs_bg.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ def main():
2929
threads = []
3030
threads.append(launch_demo_mode_thread(keep_api_url))
3131
threads.append(launch_uptime_reporting_thread())
32+
33+
logger.info("Background server jobs threads launched, joining them.")
3234

3335
for thread in threads:
3436
if thread is not None:
3537
thread.join()
3638

37-
logger.info("Background server jobs started.")
39+
logger.info("Background server jobs script executed and exiting.")
3840

3941

4042
if __name__ == "__main__":

0 commit comments

Comments
 (0)