From 6927356998a3a44e8890af4b945c62c011ae1519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Mon, 19 Feb 2024 16:55:16 +0100 Subject: [PATCH] removed cprofiler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- server/app.py | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/server/app.py b/server/app.py index 4f83a6e..5daf2b5 100644 --- a/server/app.py +++ b/server/app.py @@ -9,8 +9,6 @@ import time from multiprocessing import Process, Pipe, Queue from queue import Empty from ast import literal_eval -import cProfile -import pstats app = Flask(__name__) @@ -172,19 +170,13 @@ def tube_index_collector(ti_queue, ti_sender): ti_sender.send(None) if __name__ == "__main__": - with cProfile.Profile as profile: - try: - (ti_receiver,ti_sender) = Pipe(True) - ti_queue = Queue() - collector_thread = Process(target=tube_index_collector, args=(ti_queue, ti_sender, )) - collector_thread.start() - ti_updater_thread = Process(target=tube_index_updater, args=(ti_queue, )) - ti_updater_thread.start() - publisher_thread = Process(target=mqtt_publisher, args=(ti_receiver, )) - publisher_thread.start() - flask_thread = Process(target=flask_api) - flask_thread.start() - except KeyboardInterrupt: - result = pstats.Stats(profile) - result.sort_stats(pstats.SortKey.TIME) - result.print_stats() \ No newline at end of file + (ti_receiver,ti_sender) = Pipe(True) + ti_queue = Queue() + collector_thread = Process(target=tube_index_collector, args=(ti_queue, ti_sender, )) + collector_thread.start() + ti_updater_thread = Process(target=tube_index_updater, args=(ti_queue, )) + ti_updater_thread.start() + publisher_thread = Process(target=mqtt_publisher, args=(ti_receiver, )) + publisher_thread.start() + flask_thread = Process(target=flask_api) + flask_thread.start() \ No newline at end of file