Commit 2caae6ae authored by Pelayo Torres's avatar Pelayo Torres
Browse files

Timeout env

parent 83b9ec5f
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ from flask import current_app
import asyncio
import aiohttp
from util import dict_to_camel_case, clean_empty, serialize_clean_camel_case
import os

class Notifications():

@@ -67,7 +68,7 @@ class Notifications():

    def request_post(self, url, data):
        headers = {'content-type': 'application/json'}
        return requests.post(url, json={'text': str(data.to_str())}, headers=headers, timeout=10)
        return requests.post(url, json={'text': str(data.to_str())}, headers=headers, timeout=os.getenv("TIMEOUT"))
    
    async def send_request(self, url, data):
        async with aiohttp.ClientSession() as session:
+2 −1
Original line number Diff line number Diff line
import requests
import os


class Notifications():
@@ -9,4 +10,4 @@ class Notifications():

    def request_post(self, url, data):
        headers = {'content-type': 'application/json'}
        return requests.post(url, json={'text': str(data.to_str())}, headers=headers, timeout=10)
 No newline at end of file
        return requests.post(url, json={'text': str(data.to_str())}, headers=headers, timeout=int(os.getenv("TIMEOUT")))
 No newline at end of file
+2 −0
Original line number Diff line number Diff line
@@ -158,6 +158,7 @@ services:
      - CONTAINER_NAME=api-events
      - MONITORING=${MONITORING}
      - LOG_LEVEL=${LOG_LEVEL}
      - TIMEOUT=10
    extra_hosts:
      - host.docker.internal:host-gateway
      - fluent-bit:host-gateway
@@ -232,6 +233,7 @@ services:
      - VAULT_ACCESS_TOKEN=dev-only-token
      - VAULT_PORT=8200
      - LOG_LEVEL=${LOG_LEVEL}
      - TIMEOUT=10
    extra_hosts:
      - host.docker.internal:host-gateway
      - fluent-bit:host-gateway
+2 −0
Original line number Diff line number Diff line
@@ -8,6 +8,8 @@ services:
      - ./mock_server:/usr/src/app
    extra_hosts:
      - host.docker.internal:host-gateway
    environment:
      - DEBUG_MODE=True
    restart: unless-stopped
    image: labs.etsi.org:5050/ocf/capif/mock_server:latest

+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ services:
      - VAULT_ACCESS_TOKEN=dev-only-token
      - VAULT_PORT=8200
      - LOG_LEVEL=${LOG_LEVEL}
      - TIMEOUT=10
    extra_hosts:
      - host.docker.internal:host-gateway
      - vault:host-gateway
Loading