From a3d1664536d9c607aee5fc8a469d1a0443531e74 Mon Sep 17 00:00:00 2001 From: Jindrich Kolman Date: Mon, 20 Mar 2023 15:15:28 +0100 Subject: [PATCH 1/4] ignore .idea even in subdirs --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c806da194..39d16e36c 100644 --- a/.gitignore +++ b/.gitignore @@ -113,7 +113,7 @@ dmypy.json #Others /.benchmarks /benchmark*.svg -/.idea +.idea dump.rdb # Redis From 5af62f511d42d9ffab9a06d07122937c37e28259 Mon Sep 17 00:00:00 2001 From: Jindrich Kolman Date: Mon, 20 Mar 2023 19:11:58 +0100 Subject: [PATCH 2/4] make max_size changeable --- remoulade/api/main.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/remoulade/api/main.py b/remoulade/api/main.py index ab6058f31..895585425 100644 --- a/remoulade/api/main.py +++ b/remoulade/api/main.py @@ -108,10 +108,8 @@ def requeue_message(message_id): @app.route("/messages/result/") @marshal_with(ResponseSchema) -def get_results(message_id): +def get_results(message_id, max_size:int = 1e4): from ..message import get_encoder - - max_size = 1e4 try: result = Result(message_id=message_id).get() encoded_result = get_encoder().encode(result).decode("utf-8") From 84a726293df564fc8d853476e86abf6bf3e80454 Mon Sep 17 00:00:00 2001 From: Jindrich Kolman Date: Mon, 20 Mar 2023 19:12:37 +0100 Subject: [PATCH 3/4] disambiguate error from result --- remoulade/api/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/remoulade/api/main.py b/remoulade/api/main.py index 895585425..1bea91a14 100644 --- a/remoulade/api/main.py +++ b/remoulade/api/main.py @@ -118,11 +118,11 @@ def get_results(message_id, max_size:int = 1e4): encoded_result = f"The result is too big {size_result / 1e6}M" return {"result": encoded_result} except ResultMissing: - return {"result": "result is missing"} + return {"error": "result is missing"} except NoResultBackend: - return {"result": "no result backend"} + return {"error": "no result backend"} except (UnicodeDecodeError, TypeError): - return {"result": "non serializable result"} + return {"error": "non serializable result"} @app.route("/messages", methods=["POST"]) From ae4a5a7c039468db1c1b0b3585e0f810f099f1d8 Mon Sep 17 00:00:00 2001 From: Jindrich Kolman Date: Mon, 20 Mar 2023 19:12:49 +0100 Subject: [PATCH 4/4] typo --- remoulade/message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remoulade/message.py b/remoulade/message.py index 8fde3f239..efbf03577 100644 --- a/remoulade/message.py +++ b/remoulade/message.py @@ -59,7 +59,7 @@ class Message( """Encapsulates metadata about messages being sent to individual actors. Parameters: - queue_name(str): The name of the queue the message belogns to. + queue_name(str): The name of the queue the message belongs to. actor_name(str): The name of the actor that will receive the message. args(tuple): Positional arguments that are passed to the actor. kwargs(dict): Keyword arguments that are passed to the actor.