From 42c8b17d49df675b20b0a361d73a2df111d41924 Mon Sep 17 00:00:00 2001 From: Ask Solem Date: Thu, 13 Oct 2016 14:31:01 -0700 Subject: [PATCH] oid_from now accepts threads argument that if set to false does not use get_ident() --- kombu/common.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kombu/common.py b/kombu/common.py index 1005b405..4662ff31 100644 --- a/kombu/common.py +++ b/kombu/common.py @@ -53,8 +53,13 @@ def generate_oid(node_id, process_id, thread_id, instance): return str(uuid3(NAMESPACE_OID, ent)) -def oid_from(instance): - return generate_oid(get_node_id(), os.getpid(), get_ident(), instance) +def oid_from(instance, threads=True): + return generate_oid( + get_node_id(), + os.getpid(), + get_ident() if threads else 0, + instance, + ) class Broadcast(Queue):