dotask 0.3.2__tar.gz → 0.3.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dotask-0.3.2 → dotask-0.3.3}/PKG-INFO +1 -1
- {dotask-0.3.2 → dotask-0.3.3}/dotask/task.py +14 -2
- {dotask-0.3.2 → dotask-0.3.3}/dotask.egg-info/PKG-INFO +1 -1
- {dotask-0.3.2 → dotask-0.3.3}/setup.cfg +1 -1
- {dotask-0.3.2 → dotask-0.3.3}/LICENSE +0 -0
- {dotask-0.3.2 → dotask-0.3.3}/README.md +0 -0
- {dotask-0.3.2 → dotask-0.3.3}/dotask/__init__.py +0 -0
- {dotask-0.3.2 → dotask-0.3.3}/dotask/util/__init__.py +0 -0
- {dotask-0.3.2 → dotask-0.3.3}/dotask/util/limit.py +0 -0
- {dotask-0.3.2 → dotask-0.3.3}/dotask/util/logger.py +0 -0
- {dotask-0.3.2 → dotask-0.3.3}/dotask/util/shell.py +0 -0
- {dotask-0.3.2 → dotask-0.3.3}/dotask/util/timer.py +0 -0
- {dotask-0.3.2 → dotask-0.3.3}/dotask.egg-info/SOURCES.txt +0 -0
- {dotask-0.3.2 → dotask-0.3.3}/dotask.egg-info/dependency_links.txt +0 -0
- {dotask-0.3.2 → dotask-0.3.3}/dotask.egg-info/top_level.txt +0 -0
- {dotask-0.3.2 → dotask-0.3.3}/pyproject.toml +0 -0
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import sys
|
|
1
2
|
import threading
|
|
2
3
|
import functools
|
|
3
4
|
import time
|
|
4
5
|
import queue
|
|
6
|
+
import traceback
|
|
7
|
+
import os
|
|
5
8
|
from queue import Queue
|
|
6
9
|
from typing import Optional, Callable, Any, List, Set, Dict
|
|
7
10
|
from dotask.util import logger
|
|
@@ -152,7 +155,7 @@ def task(
|
|
|
152
155
|
# logger.info(f"消费后发布[{t}]:{consume_result}")
|
|
153
156
|
|
|
154
157
|
except Exception as e:
|
|
155
|
-
logger.error(f"Consumer [{thread_name}] failed to process message: {e}")
|
|
158
|
+
logger.error(f"Consumer [{thread_name}] failed to process message: {e}, Approximate exception location: File {get_business_error_line()}")
|
|
156
159
|
topic_manager.unfinished_tasks.put({"unfinished_data":data,"occurred":subscribe,"error":e})
|
|
157
160
|
|
|
158
161
|
# 开始消费
|
|
@@ -170,4 +173,13 @@ def task(
|
|
|
170
173
|
raise ValueError(f"Unsupported role: {role}, available options: producer/consumer")
|
|
171
174
|
|
|
172
175
|
wrapper_result = wrapper()
|
|
173
|
-
return wrapper_result
|
|
176
|
+
return wrapper_result
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
def get_business_error_line():
|
|
180
|
+
exc_type, exc_value, exc_tb = sys.exc_info()
|
|
181
|
+
tb_frames = traceback.extract_tb(exc_tb)
|
|
182
|
+
business_frame = tb_frames[-1]
|
|
183
|
+
business_file, business_line = business_frame[0], business_frame[1]
|
|
184
|
+
business_file_abs = os.path.abspath(business_file)
|
|
185
|
+
return f"{business_file_abs}:{business_line}"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|