Peter Mutwiri commited on
Commit
a6bbe2f
ยท
1 Parent(s): 24d6007

refactored datasource added time import

Browse files
Files changed (1) hide show
  1. app/routers/datasources.py +3 -3
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
- # โœ… NEW: Pass RAW PAYLOAD to worker (not just ID)
111
- # In your HF datasource router
112
  task = {
113
- "id": f"detect_entity_{source_id}_{int(time.time())}", # Unique ID
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,