()
| 43 | } |
| 44 | |
| 45 | async clearExpired(): Promise<void> { |
| 46 | const now = Date.now(); |
| 47 | for (const [key, writer] of this.uploads.entries()) { |
| 48 | if (now - writer.lastUpdate > UploadManager.timeout) { |
| 49 | try { |
| 50 | await writer.stop(); |
| 51 | this.uploads.delete(key); |
| 52 | } catch (e) { |
| 53 | console.error(`Failed to stop upload writer for key ${key}:`, e); |
| 54 | } |
| 55 | } |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | async exit() { |
| 60 | for (const [key, writer] of this.uploads.entries()) { |
no test coverage detected