diff options
| author | Li Zhineng <[email protected]> | 2025-07-15 21:07:48 +0800 |
|---|---|---|
| committer | Li Zhineng <[email protected]> | 2025-07-15 21:08:02 +0800 |
| commit | 28e956fe8898b078ebcb798155a99930b96e14ac (patch) | |
| tree | 8b4140326dc1f61c3c0e6f49478eee0c7adaf321 /main.mjs | |
| parent | b63bb1770112673bc41561dfe2cde7d8d83e3a9e (diff) | |
| download | setup-28e956fe8898b078ebcb798155a99930b96e14ac.tar.gz setup-28e956fe8898b078ebcb798155a99930b96e14ac.zip | |
timeout after 3 seconds
Diffstat (limited to 'main.mjs')
| -rw-r--r-- | main.mjs | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -853,7 +853,9 @@ class SuccessForm extends Form { // We are using HTTP because the domain name is remapped to our local // mock server, and the communication between the device and our mock // server utilizes the HTTP protocol as well. - const response = await fetch(`http://i.airmx.cn/exchange?device=${this.#deviceId}`) + const response = await fetch(`http://i.airmx.cn/exchange?device=${this.#deviceId}`, { + signal: AbortSignal.timeout(3000) + }) if (! response.ok) { throw new Error('Could not retrieve the device key.') |
