|
19 | 19 | import os |
20 | 20 | import asyncio |
21 | 21 | import sys |
22 | | -import time |
23 | 22 | from typing import List, Any, Tuple, Callable, Dict |
24 | 23 | from charon.config import get_config |
25 | | -from charon.constants import DEFAULT_RADAS_SIGN_TIMEOUT_RETRY_COUNT |
26 | | -from charon.constants import DEFAULT_RADAS_SIGN_TIMEOUT_RETRY_INTERVAL |
27 | 24 | from charon.pkgs.oras_client import OrasClient |
28 | 25 | from proton import Event |
29 | 26 | from proton.handlers import MessagingHandler |
@@ -105,33 +102,11 @@ def generate_radas_sign(top_level: str, sign_result_loc: str) -> Tuple[List[str] |
105 | 102 | """ |
106 | 103 | Generate .asc files based on RADAS sign result json file |
107 | 104 | """ |
108 | | - conf = get_config() |
109 | | - rconf = conf.get_radas_config() if conf else None |
110 | | - timeout_retry_count = ( |
111 | | - rconf.radas_sign_timeout_retry_count() if rconf else DEFAULT_RADAS_SIGN_TIMEOUT_RETRY_COUNT |
112 | | - ) |
113 | | - timeout_retry_interval = ( |
114 | | - rconf.radas_sign_timeout_retry_interval() |
115 | | - if rconf |
116 | | - else DEFAULT_RADAS_SIGN_TIMEOUT_RETRY_INTERVAL |
117 | | - ) |
118 | | - wait_count = 0 |
119 | | - |
120 | | - # Wait until files appear in the sign_result_loc directory |
121 | | - while True: |
122 | | - files = [ |
123 | | - os.path.join(sign_result_loc, f) |
124 | | - for f in os.listdir(sign_result_loc) |
125 | | - if os.path.isfile(os.path.join(sign_result_loc, f)) |
126 | | - ] |
127 | | - if files: # If files exist, break the loop |
128 | | - break |
129 | | - |
130 | | - wait_count += 1 |
131 | | - if wait_count > timeout_retry_count: |
132 | | - logger.warning("Timeout when waiting for sign response.") |
133 | | - break |
134 | | - time.sleep(timeout_retry_interval) |
| 105 | + files = [ |
| 106 | + os.path.join(sign_result_loc, f) |
| 107 | + for f in os.listdir(sign_result_loc) |
| 108 | + if os.path.isfile(os.path.join(sign_result_loc, f)) |
| 109 | + ] |
135 | 110 |
|
136 | 111 | if not files: |
137 | 112 | return [], [] |
|
0 commit comments