worker-automate-hub 0.5.750__py3-none-any.whl → 0.5.751__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -232,30 +232,34 @@ async def get_config_by_name(name: str) -> RpaConfiguracao:
232
232
  if "API_BASE_URL" not in env_config:
233
233
  raise ValueError("URL da API não encontrada na configuração do ambiente")
234
234
 
235
- try:
236
- headers_basic = {"Authorization": f"Basic {env_config["API_AUTHORIZATION"]}"}
237
- timeout = aiohttp.ClientTimeout(total=600)
238
-
239
- async with aiohttp.ClientSession(
240
- connector=aiohttp.TCPConnector(verify_ssl=True), timeout=timeout
241
- ) as session:
242
- async with session.get(
243
- f"{env_config["API_BASE_URL"]}/configuracao/api/{name}",
244
- headers=headers_basic,
245
- ) as response:
246
- if response.status != 200:
247
- raise Exception(f"Erro ao obter a configuração: {response.content}")
248
- data = await response.json()
249
- return RpaConfiguracao(**data)
250
-
251
- except Exception as e:
252
- err_msg = f"Erro ao obter a configuração: {e}"
253
- logger.error(err_msg)
254
- console.print(
255
- f"{err_msg}\n",
256
- style="bold red",
257
- )
258
- return None
235
+ x = 0
236
+ while x < 10:
237
+ try:
238
+ headers_basic = {"Authorization": f"Basic {env_config["API_AUTHORIZATION"]}"}
239
+ timeout = aiohttp.ClientTimeout(total=600)
240
+
241
+ async with aiohttp.ClientSession(
242
+ connector=aiohttp.TCPConnector(verify_ssl=True), timeout=timeout
243
+ ) as session:
244
+ async with session.get(
245
+ f"{env_config["API_BASE_URL"]}/configuracao/api/{name}",
246
+ headers=headers_basic,
247
+ ) as response:
248
+ if response.status != 200:
249
+ console.print(f"Erro ao obter a configuração: {response.content}")
250
+ x += 1
251
+ else:
252
+ data = await response.json()
253
+ return RpaConfiguracao(**data)
254
+ except Exception as e:
255
+ x += 1
256
+ err_msg = f"Erro ao obter a configuração: {e}"
257
+ logger.error(err_msg)
258
+ console.print(
259
+ f"{err_msg}\n",
260
+ style="bold red",
261
+ )
262
+ return None
259
263
 
260
264
 
261
265
  def sync_get_config_by_name(name: str) -> RpaConfiguracao:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: worker-automate-hub
3
- Version: 0.5.750
3
+ Version: 0.5.751
4
4
  Summary: Worker Automate HUB é uma aplicação para automatizar rotinas de RPA nos ambientes Argenta.
5
5
  Author: Joel Paim
6
6
  Requires-Python: >=3.12,<4.0
@@ -1,7 +1,7 @@
1
1
  worker_automate_hub/__init__.py,sha256=LV28uQvBfpPIqudGIMJmVB8E941MjXHcu8DMoX5n8AM,25
2
2
  worker_automate_hub/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  worker_automate_hub/api/ahead_service.py,sha256=QbNrZf9q7fS0s-S5fZVytqC7dINi9u2f6aB6SDrGVVA,2231
4
- worker_automate_hub/api/client.py,sha256=dKHMJEwBPo5_r-9487APuZmnVjKh3WaiwpNZIN0j2vs,31763
4
+ worker_automate_hub/api/client.py,sha256=gKuIUhdAiMFE4YK3nR4SR2W8p1v4--7I64Pjs0oJsyM,31956
5
5
  worker_automate_hub/api/datalake_service.py,sha256=qw_N_OOgDKDuPbI-fdYkWWTlT4CUtFTl0VVlZ0fLM-M,3001
6
6
  worker_automate_hub/api/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  worker_automate_hub/api/helpers/api_helpers.py,sha256=SkheO2fXexeh-a4shr8Qzsz_kZhuSG0DJ7kbODctRbM,3696
@@ -100,7 +100,7 @@ worker_automate_hub/utils/updater.py,sha256=en2FCGhI8aZ-JNP3LQm64NJDc4awCNW7UhbV
100
100
  worker_automate_hub/utils/util.py,sha256=gFe4yrF2G6sToawOzlgRFWEJKlqtWYp4lXQFKgNQpZg,207420
101
101
  worker_automate_hub/utils/utils_nfe_entrada.py,sha256=TOXKSHOPxy8N3-ROpTGjNIHstX0i2b8qekcj1tRvjG8,38174
102
102
  worker_automate_hub/worker.py,sha256=uhZ3f-iaQ1i8cANbljp50vkYl-Xm0_sHtjwwF_2y72o,7191
103
- worker_automate_hub-0.5.750.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
104
- worker_automate_hub-0.5.750.dist-info/METADATA,sha256=CSIfO_UBC7aPmcXSJguES1sp8CnW6jr7Yg5ggGjs-Mo,3049
105
- worker_automate_hub-0.5.750.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
106
- worker_automate_hub-0.5.750.dist-info/RECORD,,
103
+ worker_automate_hub-0.5.751.dist-info/entry_points.txt,sha256=sddyhjx57I08RY8X7UxcTpdoOsWULAWNKN9Xr6pp_Kw,54
104
+ worker_automate_hub-0.5.751.dist-info/METADATA,sha256=InFgMNvp97iVLoHcgK3iTAbLr_12mSDwPfIAVHEC0mI,3049
105
+ worker_automate_hub-0.5.751.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
106
+ worker_automate_hub-0.5.751.dist-info/RECORD,,