79100450

Date: 2024-10-18 03:37:06
Score: 1
Natty:
Report link

Have you tried to modify your DAG to include timeout and retry parameters, something like this?

     task_get_posts = SimpleHttpOperator(
     task_id="get_posts",
     http_conn_id="api_posts",
     endpoint="api/chat.postMessage",
     method="POST",
     headers={
         "Authorization": "Bearer #token",
         "Content-Type": "application/json"
     },
     data=json.dumps({
         "channel": "#channel",
         "text": "Hello from airflow"
     }),
     response_filter=lambda response: json.loads(response.text),
     log_response=True,
     execution_timeout=timedelta(seconds=60),  # Add timeout
     retries=3,  # Add retries
     retry_delay=timedelta(seconds=5),  # Add retry delay
     dag=dag,
 )
 
Reasons:
  • Whitelisted phrase (-1): Have you tried
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: vmhung