Francisco Aranda commited on
Commit
bcf795e
·
1 Parent(s): ea4e048

chore :Adapt listeners

Browse files
Files changed (1) hide show
  1. main.py +6 -6
main.py CHANGED
@@ -16,23 +16,23 @@ incoming_events = Queue()
16
 
17
  @rg.webhook_listener(events=["record.created", "record.updated", "record.completed"])
18
  async def record_events(record: rg.Record, type: str, **kwargs):
19
- print("Received event", type)
20
 
21
  incoming_events.put(record)
22
 
 
23
  # Create a webhook for dataset events
24
  @rg.webhook_listener(events=["dataset.created", "dataset.updated", "dataset.published"])
25
- async def dataset_events(type: str, dataset: rg.Dataset | None = None, **kwargs):
26
- print(f"Received event {type} for dataset {dataset.id}")
27
 
28
  incoming_events.put((type, dataset))
29
 
30
 
31
-
32
  # Create a webhook for response events
33
  @rg.webhook_listener(events=["response.created", "response.updated"])
34
- async def response_events(response: rg.UserResponse, type:str, **kwargs):
35
- print("Received event type", type)
36
 
37
  incoming_events.put(response)
38
 
 
16
 
17
  @rg.webhook_listener(events=["record.created", "record.updated", "record.completed"])
18
  async def record_events(record: rg.Record, type: str, **kwargs):
19
+ print("Received event", type, record)
20
 
21
  incoming_events.put(record)
22
 
23
+
24
  # Create a webhook for dataset events
25
  @rg.webhook_listener(events=["dataset.created", "dataset.updated", "dataset.published"])
26
+ async def dataset_events(type: str, dataset: rg.Dataset, **kwargs):
27
+ print(f"Received event", type, dataset)
28
 
29
  incoming_events.put((type, dataset))
30
 
31
 
 
32
  # Create a webhook for response events
33
  @rg.webhook_listener(events=["response.created", "response.updated"])
34
+ async def response_events(type:str, response: rg.UserResponse, **kwargs):
35
+ print(f"Received event", type, response)
36
 
37
  incoming_events.put(response)
38