()
| 142 | |
| 143 | |
| 144 | def _ensure_deploys(): |
| 145 | now = time.time() |
| 146 | if _deploy_cache['data'] and now - _deploy_cache['ts'] < _CACHE_TTL: |
| 147 | return |
| 148 | if not _deploy_lock.acquire(blocking=False): |
| 149 | return |
| 150 | try: |
| 151 | deploys = _fetch_all_deploys() |
| 152 | if deploys: |
| 153 | _deploy_cache['data'] = deploys |
| 154 | _deploy_cache['ts'] = now |
| 155 | finally: |
| 156 | _deploy_lock.release() |
| 157 | |
| 158 | |
| 159 | # ---- Branch lag ---- |
no test coverage detected