* Rclone API Ping 检查
()
| 129 | * Rclone API Ping 检查 |
| 130 | */ |
| 131 | async function rclone_api_noop(): Promise<boolean> { |
| 132 | try { |
| 133 | const url = buildApiUrl('/rc/noop') |
| 134 | const res = await fetch(url, { |
| 135 | method: 'POST', |
| 136 | headers: { Authorization: getRcloneApiHeaders().Authorization }, |
| 137 | }) |
| 138 | return res.ok |
| 139 | } catch (e) { |
| 140 | console.log('Rclone ping failed:', e) |
| 141 | return false |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | /** |
| 146 | * Rclone API POST 请求 |
no test coverage detected