Peter Mutwiri commited on
Commit ยท
a6bbe2f
1
Parent(s): 24d6007
refactored datasource added time import
Browse files
app/routers/datasources.py
CHANGED
|
@@ -107,10 +107,10 @@ async def create_source_json(
|
|
| 107 |
# 1. ๐พ Store raw data for audit & lineage
|
| 108 |
bootstrap(orgId, payload.data)
|
| 109 |
print(f"[api/json] โ
Raw data stored for org: {orgId}")
|
| 110 |
-
#
|
| 111 |
-
|
| 112 |
task = {
|
| 113 |
-
"id": f"
|
| 114 |
"function": "detect_entity", # ๐ฏ Must match registry
|
| 115 |
"args": {
|
| 116 |
"org_id": org_id,
|
|
|
|
| 107 |
# 1. ๐พ Store raw data for audit & lineage
|
| 108 |
bootstrap(orgId, payload.data)
|
| 109 |
print(f"[api/json] โ
Raw data stored for org: {orgId}")
|
| 110 |
+
# Pass RAW PAYLOAD to worker (not just ID)
|
| 111 |
+
timestamp = int(datetime.datetime.now().timestamp())
|
| 112 |
task = {
|
| 113 |
+
"id": f"detect_entity:{org_id}:{source_id}:{timestamp}", # Unique ID
|
| 114 |
"function": "detect_entity", # ๐ฏ Must match registry
|
| 115 |
"args": {
|
| 116 |
"org_id": org_id,
|