( owner: string, repo: string, filename: string, path: string, branch: string, env: Env, )
| 140 | * @param env - Environment with Cloudflare bindings |
| 141 | */ |
| 142 | export async function cacheFilePath( |
| 143 | owner: string, |
| 144 | repo: string, |
| 145 | filename: string, |
| 146 | path: string, |
| 147 | branch: string, |
| 148 | env: Env, |
| 149 | ): Promise<void> { |
| 150 | try { |
| 151 | const key = getRepoFilePathCacheKey(owner, repo); |
| 152 | await setInCache(key, { path, branch }, env, getCacheTTL()); |
| 153 | console.log( |
| 154 | `Cached file path for ${filename} in ${owner}/${repo}: ${path}`, |
| 155 | ); |
| 156 | } catch (error) { |
| 157 | console.warn("Failed to save to cache:", error); |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | /** |
| 162 | * Cache key structure for robots.txt content |
no test coverage detected